Porblem with xlutils/xlrd/xlwt

pp parul.pandey85 at gmail.com
Sat Jan 9 05:24:16 EST 2010


Whenever i run the code below I get the following error:

AttributeError: 'Book' object has no attribute 'on_demand'
WARNING: Failure executing file: <copy.py>

Why is it so??

from xlrd import open_workbook
from xlwt import easyxf
from xlutils.copy import copy
rb =  open_workbook('source.xls',formatting_info=True)
rs =  rb.sheet_by_index(0)
wb =  copy(rb)
ws =  wb.get_sheet(0)
plain = easyxf('')
for i,cell in enumerate(rs.col(2)):
     if not i:
         continue
     ws.write(i,2,cell.value,plain)
for i,cell in enumerate(rs.col(4)):
     if not i:
         continue
     ws.write(i,4,cell.value-1000)
wb.save('output.xls')




More information about the Python-list mailing list