This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| # 数据下载 http://www.tdx.com.cn/download | |
| # 上海 http://www.tdx.com.cn/products/data/data/vipdoc/shlday.zip | |
| # 深圳 http://www.tdx.com.cn/products/data/data/vipdoc/szlday.zip | |
| # 通达信 K 线记录格式 | |
| ''' | |
| 日期, date | |
| 开盘, open |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from struct import * | |
| ofile=open('sz000680.day','rb') | |
| buf=ofile.read() | |
| ofile.close() | |
| ifile=open('sz000680.txt','w') | |
| num=len(buf) | |
| no=num/32 | |
| b=0 | |
| e=32 |