#!/Users/berg/anaconda3/bin/python
#本次使用公开免费(baostock接口)提前安装好#http://baostock.com/baostock/index.php/%E9%A6%96%E9%A1%B5
import baostock as bs
import pandas as pd
import pymysql
import time
import datetime
now = datetime.datetime.now()
now=str(now)
print(now)
conn = pymysql.connect(
host=“localhost”,
user=“root”,password=“xxxx”,
database=“xxxxx”,
charset=“utf8”)
cursor = conn.cursor()
lg = bs.login()
#参数名称 参数描述get_query_all_stock()
#code 证券代码
#tradeStatus 交易状态(1:正常交易 0:停牌)
#code_name 证券名称
def get_query_all_stock(): #获取 证券代码查询,返回所有股票代码的值
pass
rs = bs.query_all_stock(day=“2021-03-08”)
print(‘query_all_stock respond error_code:’+rs.error_code