python使用用Wind接口获取全部A股历史交易数据14人已关注 果然是中文编码的问题。搞定了,新鲜出炉一个小脚本。谢谢各位大神的解答。"""***@Author:******@Date:2014-11-******@Version:"""#!/user/python#-*-coding:gb2312-*-importosimportsysimportgetoptfromWindPyimport*fromdatetimeimport*classLoadHisInfo:def__init__(self):=r'E:'=[]defStartWind(self):()defLoadStockList(self):res=("SectorConstituent","date=;sector=全部A股")!=0:print('Error['+str()+'][loadstockcodelistfail]\n')()foriinrange(0,len([0])):forkinrange(0,len()):if([k]=='date'):date=[k][i]if([k]=="wind_code"):code=[k][i]if([k]=="sec_name"):name=[k][i](code)defLoadHisInfo(self)::outputPath=+code+r'.txt'data=(code,"open,high,low,close","19900101","",showblank=0)!=0:print('Error['+str()+'][loadhistoryinfofail]\n')()fOutputObj=open(('gbk'),'a')foriinrange(0,len([0])):date=str([i])forkinrange(0,len()):if([k]=="OPEN"):openPrice=[k][i]if([k]=="LOW"):lowPrice=[k][i]if([k]=="HIGH"):highPrice=[k][i]if([k]=="CLOSE"):closePrice=[k][i]if(openPrice==0)or(lowPrice==0)or(highPrice==0)or(closePrice==0):continueresult=date[0
Python提取Wind数据 来自淘豆网m.daumloan.com转载请标明出处.