-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcode.py
More file actions
30 lines (27 loc) · 693 Bytes
/
Copy pathcode.py
File metadata and controls
30 lines (27 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- coding:utf-8 -*-
#! python3
# FaceCat-Python(OpenSource)
#Shanghai JuanJuanMao Information Technology Co., Ltd
import math
import requests
import time
from requests.adapters import HTTPAdapter
import qstock as qs
import os
#pip install qstock
df = qs.realtime_data()
path = os.getcwd() + "\\codes.txt"
if os.path.exists(path):
os.remove(path)
fs = open(path,'a+', encoding="UTF-8")
for i in range(0,len(df.columns)):
print(df.columns[i])
for i in range(0, len(df)):
sCode = df.iloc[i][df.columns[0]]
if(sCode.find("6") == 0):
sCode += ".SH"
else:
sCode += ".SZ"
sName = df.iloc[i][df.columns[1]]
fs.write(sCode + ',' + sName + '\n')
fs.close()