这里只写一下界面及想法。不进行代码的实现。因为对流程不是很熟
###界面
数据库的链接:
ptrade
USER = '可转债量化分析'
PASSWORD = '123456'
MYSQL_HOST = 'mysql.sqlpub.com'
MYSQL_PORT = 3306
MYSQL_DB = 'ptrade'
def get_mysql_conn():
import pymysql
try:
conn = pymysql.connect(host=MYSQL_HOST,
port=MYSQL_PORT,
user=USER,
password=PASSWORD,
db=MYSQL_DB,
charset='utf8')
except Exception as e:
log.error(e)
raise ValueError('连接mysql失败')
else:
return conn