It depends exactly what you mean by this as to whether I'd recommend
xlutils.copy or xlutils.filter.
Can you give some example code for the modifications you wish to make?
Both xlutils.copy and xlutils.filter have docs in the docs folder of the
source distribution of xlutils. Perhaps you could have a read of those
and let me know what doesn't make sense?
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
- it's hard when using xlutils.copy to keep formatting for an existing
cell whose value you want to modify.
- neither xlwt nor xlrd support conditional formatting, so xlutils can't
help you there either.
> I'm having trouble with the specifics of using a global reader, a
> global writer when using the filter module or keeping the formatting
> when just using copy ...
Dunno what you mean by global reader or global writer.
I'd probably do something like:
from xlrd import open_workbook
from xlwt import easyxf
from xlutils.copy import copy
# customise this to your needs, have more than one style
# if you need it
mystyle = easyxf('font:color red;')
rb = open_workbook('source.xls',formatting_info=True)
wb = copy(rb)
# do whatever modifications you need
wb.get_sheet(0).write(10,10,'some value',mystyle)
wb.save('output.xls')
Yes, it's not keeping the original formatting of the modified cells, but
it's better than nothing ;-)