[Tutor] saving .csv file as an xl worksheet

Kent Johnson kent37 at tds.net
Mon Mar 6 22:34:04 CET 2006


arun wrote:
> Hi ,
>   Can i save a file with a desired extension??
> for ex:  I have a .csv file (test.csv) and i want to save this file as 
> test.xls from a python script.

It's easy to rename a file, or read it and save it with whatever name 
you like, but that won't convert it to an actual Excel worksheet. To 
write true xls files you can use win32com to control Excel through its 
COM interface (google python excel for many examples) or you can use 
pyExcelerator.
http://cheeseshop.python.org/pypi/pyExcelerator/0.6.0a

Kent



More information about the Tutor mailing list