stock_daily_fetcher.py 文件源码

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

项目:strategy 作者: kanghua309 项目源码 文件源码
def _update(stock,begin, conn):
    print "update ----- :", stock
    try:
        df = ts.get_h_data(stock, start=begin, retry_count=5, pause=1)
        if len(df) != 0:
           print df.head(2)
           df[['open', 'high', 'close', 'low', 'volume']].to_sql(stock, conn, if_exists='append')
        import time
        time.sleep(10)
    except Exception, arg:
        print "exception:", stock, arg
        raise SystemExit(-1)
        #errorlist.append(stock)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号