Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
crawler
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
backend
crawler
Commits
d18bba96
Commit
d18bba96
authored
4 years ago
by
zhangmeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
替换sql语句
parent
e58c9a3f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
func_send_email_with_file.py
maintenance/func_send_email_with_file.py
+1
-1
crawler_data_id_from_mysql.py
maintenance/temp_file/crawler_data_id_from_mysql.py
+2
-2
No files found.
maintenance/func_send_email_with_file.py
View file @
d18bba96
...
@@ -131,7 +131,7 @@ def send_file_email(file_path, data_str, email_group=[],
...
@@ -131,7 +131,7 @@ def send_file_email(file_path, data_str, email_group=[],
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
send_file_email
(
""
,
''
,
sender
=
"
litao@igengmei.com"
,
email_group
=
[
"litao@igengmei.com"
],
email_msg_body_str
=
"test"
,
title_str
=
"test"
,
cc_group
=
[
"litao
@igengmei.com"
],
file
=
"data.csv"
)
send_file_email
(
""
,
''
,
sender
=
"
zhangmeng@igengmei.com"
,
email_group
=
[
"zhangmeng@igengmei.com"
],
email_msg_body_str
=
"test"
,
title_str
=
"test"
,
cc_group
=
[
"zhangmeng
@igengmei.com"
],
file
=
"data.csv"
)
...
...
This diff is collapsed.
Click to expand it.
maintenance/temp_file/crawler_data_id_from_mysql.py
View file @
d18bba96
...
@@ -21,13 +21,13 @@ def con_sql(sql):
...
@@ -21,13 +21,13 @@ def con_sql(sql):
return
result
return
result
res_list
=
[(
"id"
,
"question_id"
,
"platform"
)]
res_list
=
[(
"id"
,
"question_id"
,
"platform"
)]
sql
=
"
select id,question_id,platform from api_answer where platform in (2,0,9)
"
sql
=
"
SELECT api_answer.question_id,api_answer.id from api_answer,api_question WHERE api_answer.question_id = api_question.id AND api_question.id > 478020
"
result
=
con_sql
(
sql
)
result
=
con_sql
(
sql
)
for
r
in
result
:
for
r
in
result
:
res_list
.
append
(
r
)
res_list
.
append
(
r
)
import
pandas
import
pandas
from
maintenance.func_send_email_with_file
import
send_file_email
from
crawler.
maintenance.func_send_email_with_file
import
send_file_email
data
=
pandas
.
DataFrame
(
res_list
)
data
=
pandas
.
DataFrame
(
res_list
)
data
.
to_excel
(
"./data_file.xlsx"
)
data
.
to_excel
(
"./data_file.xlsx"
)
send_file_email
(
""
,
''
,
sender
=
"zhangmeng@igengmei.com"
,
email_group
=
[
"zhangmeng@igengmei.com"
],
email_msg_body_str
=
"test"
,
send_file_email
(
""
,
''
,
sender
=
"zhangmeng@igengmei.com"
,
email_group
=
[
"zhangmeng@igengmei.com"
],
email_msg_body_str
=
"test"
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment