Home:ALL Converter>Error in writing excel docs with python

Error in writing excel docs with python

Ask Time:2013-07-18T01:18:36         Author:FreshPeter

Json Formatter

I am writing a program to fetch a bunch of data from the web then write it in an excel document. In the last step I am getting an error while trying to write the cells and I am not sure what the error means or what I could do to fix it.

The error looks like this:

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/xlwt/Worksheet.py", line 1030, in write
self.row(r).write(c, label, style)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/xlwt/Row.py", line 235, in write
self.__adjust_bound_col_idx(col)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/xlwt/Row.py", line 78, in __adjust_bound_col_idx
raise ValueError("column index (%r) not an int in range(256)" % arg)
ValueError: column index (256) not an int in range(256)
149-166-202-213:Peter peter$`

The error is supposedly on line 106, which is blank. It seems like I am trying to write to cells that are not within the range of the document, how could I extend the range of the excel document or change the way I'm writing to the cells to help?

BTW, the modules I'm using to access excel docs are here

Author:FreshPeter,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/17706197/error-in-writing-excel-docs-with-python
MattDMo :

The maximum number of columns in a .xls spreadsheet is 256 (according to Microsoft). If you go to the Excel 2010 format, that limit is increased to 16,384.\n\n\n\nFrom some (rather brief) research, it looks like OpenPyXL might work for you. I can't find any hard-coded column limits in its code or docs, and unfortunately I don't have a version of Excel to test it for you, but it certainly looks promising.",
2013-07-17T17:28:15
yy