所读取的文件内容:
20160309,2839.41,2863.01,2811.72,2862.56,183355383,177072553984.00
20160310,2847.57,2863.18,2803.48,2804.73,138979461,141812416512.00
20160311,2781.60,2815.61,2772.55,2810.31,127247554,128450314240.00
- import codecs
- symbol = '999999'
- csvFile = '/home/www/stock/stockInfo/stockInfo_data_index/'+str(symbol)
- File = codecs.open(csvFile,'r','gb18030') #读取文件
- line_count = 0
- item = {}
- for line in File: #循环读取每行
- line_list = line.strip() #移除字符串(一行)头尾的空格
- item_count = 0
- for r in line_lis