# [python] create excel file with multicolumns/multistrings



## nekoexmachina (Dec 29, 2010)

Hello, forums!
Im writing a little python script for generating OS stats/hw info/etc report into xls format (dont tell me xls is evil: tell it to clients that want it, not accepting even pdf).
Ive found pyExcelerator lib that (should) work for that, but well, there is NO documentation for how to use that lib. Any other variants?
Or, which would be much better, is there any good, opensource and platform-independant TeX -> doc/xls converter, that will work ok for complicated tables with multicolumns, colours and multilines?


----------



## SirDice (Dec 29, 2010)

I don't use python but I have used similar perl modules. They all use the same technique; OLE.

You can find a lot of information on Microsoft's MSDN website. It's usually quite easy to 'translate' a visual basic script to something else. As long as you handle the objects the same it doesn't matter what language you use.


----------



## dandelion (Dec 29, 2010)

Why not use CSV? MS Excel supports importing them.


----------



## PeteS (Dec 29, 2010)

CSV files can't have any formatting.

HTML however will work fine for excel. You could make an .xls file with html in it. It is supported by Microsoft and the client wouldn't even know.


----------



## PeteS (Dec 29, 2010)

BTW, excels native format inside the .xls file is BIFF.
More info here


----------



## wblock@ (Dec 29, 2010)

textproc/py-xlwriter and textproc/py-xlwt should work.  (Untested by me.)


----------



## roddierod (Dec 29, 2010)

I've not done it on FreeBSD, but I use Python at work on win32 to interact with Python all the time. As SirDice says it all via OLE.

There is a example here http://snippets.dzone.com/posts/show/2036.


----------

