安装支持库
pip install panda
pip install tushare
import tushare as ts
d = ts.get_tick_data('601318',date='2017-06-26')
print d
e = ts.get_hist_data('601318',start='2017-06-23',end='2017-06-26')
print e
执行结果
…
4758 09:30:01 50.02 0.03 1044 5226339 买盘
4759 09:28:45 49.99 -- 0 0 卖盘
4760 09:25:02 49.99 49.99 7370 36843929 买盘
…
date open high close low volume price_change p_change
2017-06-26 49.99 50.77 49.72 49.35 953192.56 0.00 0.00
2017-06-23 49.24 49.90 49.72 48.79 873719.62 0.58 1.18
ma5 ma10 ma20 v_ma5 v_ma10 v_ma20 turnover
49.222 48.320 47.288 887897.74 860166.06 857338.21 0.88
48.990 48.241 47.076 858955.61 850806.49 879173.58 0.81