import tushare as ts
import os
print ‘****‘*8
df = ts.get_k_data(code =‘600000‘,start =‘2018-01-01‘,end =‘2018-01-19‘)
#print df
df2 = ts.get_k_data(code =‘600848‘,start =‘2018-01-01‘,end =‘2018-01-19‘)
df3 = ts.get_k_data(code =‘000875‘,start =‘2018-01-01‘,end =‘2018-01-19‘)
ds = ts.get_realtime_quotes(‘sh‘)#实时股票数据
#print ds[[‘code‘,‘name‘,‘price‘,‘low‘,‘amount‘,‘date‘,‘time‘]]
dc = ts.get_index()
dd = ts.get_gdp_year()
df_ppi = ts.get_ppi()
#print df_ppi
df_ppi.to_csv(‘f:/test/00002.csv‘,na_rep = ‘NULL‘)
df2.to_csv(‘f:/test/00002.csv‘,mode = ‘a‘)
df.to_csv(‘f:/test/00003.csv‘)
df2.to_csv(‘f:/test/00003.csv‘,mode =‘a‘)
df3.to_csv(‘f:/test/00003.csv‘,mode = ‘a‘,header = None)