[Tutor] WRITING XLS FROM OS.WALK()

Walter Prins wprins at gmail.com
Fri Oct 8 23:08:29 CEST 2010


On 8 October 2010 20:34, Susana Iraiis Delgado Rodriguez <
susana.delgado_s at utzmg.edu.mx> wrote:

> Hello members:
> I developed a Python module to make a list which contains all the files
> ending with .shp and .dbf extensions, I have solved this already, but now I
> want to write an excel file from it. The file should show the full path from
> the found files. This is the code:
>
> import os
> a = open ("directorio.xls","w")
>

Excel (.xls) is not a text format.  What you've written opens
"directorio.xls" as a text file.

If you want to write an Excel format file, have a look at the xlwt (and the
xlrt for reading) Python modules. See http://www.python-excel.org/

Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101008/b574c6fc/attachment.html>


More information about the Tutor mailing list