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/DataUpdate/daily_update_d_download2/'+stock_code+'.csv')
print("save "+stock_code)
#???????????????
#????????????????
评论列表
文章目录