Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
python_resolve_data
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c5059f77
authored
Aug 27, 2024
by
larosa
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add
parent
c9397035
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
chip1stop.py
chip1stop.py
View file @
c5059f77
import
datetime
import
ftplib
import
ftplib
import
gzip
import
gzip
import
os
import
os
...
@@ -8,8 +9,12 @@ host = "ansetchip1.gotoftp11.com"
...
@@ -8,8 +9,12 @@ host = "ansetchip1.gotoftp11.com"
user
=
"ansetchip1"
user
=
"ansetchip1"
password
=
"nf6l2g17"
password
=
"nf6l2g17"
port
=
21
port
=
21
ftp_remote_path
=
"/Chip1Stop_TI_included_20240826_ETCHIPS.csv.gz"
ftp_remote_path_csv
=
"/Chip1Stop_TI_included_"
+
datetime
.
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d"
)
+
"_ETCHIPS.csv.gz"
file_local_path
=
"./Chip1Stop_TI_included_20240826_ETCHIPS.csv.gz"
ftp_remote_path_txt
=
"/Chip1StopStockList RMB_Anjie_US Stock.txt.gz"
"""暂时设置为当前路径"""
file_local_path_csv
=
"."
+
ftp_remote_path_csv
file_local_path_txt
=
"."
+
ftp_remote_path_txt
ENV
=
"test"
# ENV 取值 test 或 prod
ENV
=
"test"
# ENV 取值 test 或 prod
...
@@ -98,5 +103,7 @@ if __name__ == '__main__':
...
@@ -98,5 +103,7 @@ if __name__ == '__main__':
elif
ENV
==
"prod"
:
elif
ENV
==
"prod"
:
config
=
config_prod
config
=
config_prod
u
=
DataUtil
()
u
=
DataUtil
()
u
.
download
(
ftp_remote_path
,
file_local_path
)
u
.
download
(
ftp_remote_path_csv
,
file_local_path_csv
)
u
.
ungz
(
file_local_path
)
u
.
ungz
(
file_local_path_csv
)
u
.
download
(
ftp_remote_path_txt
,
file_local_path_txt
)
u
.
ungz
(
file_local_path_txt
)
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