stock_download.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:Stock 作者: CloudGao 项目源码 文件源码
def get_stock(stock_list,start,end,type):
    while len(stock_list)>0:
        stock_code=stock_list.pop()
        df = tushare.get_hist_data(code=stock_code,start=start,end=end,ktype=type)
        if(type == 'D'):
            stock_code = 'D_'+stock_code
        elif(type == 'W'):
            stock_code = 'W_'+stock_code
        elif(type == 'M'):
            stock_code = 'M_'+stock_code
        elif(type == '5'):
            stock_code = '5_'+stock_code
        elif(type == '15'):
            stock_code = '15_'+stock_code
        elif(type == '30'):
            stock_code = '30_'+stock_code
        elif(type == '60'):
            stock_code = '60_'+stock_code
        df.to_csv('E:/Project/Python/STOCK/DataSpider/DataInit/download/'+stock_code+'.csv')
        print("save "+stock_code)

#???????????????
#????????????????
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号