PythonXLWT简单wirting to sheet示例
有人能解释为什么我会出现以下错误:PythonXLWT简单wirting to sheet示例,python,xlwt,Python,Xlwt,有人能解释为什么我会出现以下错误: File "C:\Users\Saul Ramirez\Documents\Python Scripts\DQforecast.py", line 156, in xlsOutput forecastSheet.write(index, i, 'asdf') TypeError: object of type 'int' has no len() 对于此功能 def xlsOutput(forecasts): os.chdir('C:\\U
File "C:\Users\Saul Ramirez\Documents\Python Scripts\DQforecast.py", line 156, in xlsOutput
forecastSheet.write(index, i, 'asdf')
TypeError: object of type 'int' has no len()
对于此功能
def xlsOutput(forecasts):
os.chdir('C:\\Users\\Saul Ramirez\\Desktop')
forecastWB = xlwt.Workbook()
forecastWB_name = 'Forecasts' + str(datetime.date.today()) + '.xls'
forecastSheet = forecastWB.add_sheet('Forecasst')
i=0
for rollRate in forecasts:
for index in rollRate:
forecastSheet.write(index, i, 'asdf')
i=i+1
forecastWB.save(forecastWB_name)
显示完整的回溯-关于xlwt的哪个部分试图调用len的信息是必要的。找出它。。。愚蠢的问题对不起!