DBF (VFP) to XLS (Excel) in pure Python

Ethan Furman ethan at stoneleaf.us
Thu Dec 2 13:51:18 EST 2010


kirby.urner at gmail.com wrote:

Some ideas:

     for (i, name) in enumerate(thedbf.field_names):
         sheet1.write(0, i, name, header_style)
         thetype = thedbf.type(name)
         thelen, thedec = thedbf.size(name)
         if thetype == "M":
             thelen = 100
         elif thelen == 0:
             thelen = 1
         colwidth = max(len(name), int(thelen))
         sheet1.col(i).width = colwidth * 310

     messages = []
     for row, record in enumerate(thedbf):
         .
         .
         .

> Same error with:
> 
>>>> thetable = dbf.VfpTable(thefile)
>>>> thetable.close(keep_memos=True)

Does this still happen with the latest code?  (Not yet on PyPI for those 
following along -- hope to get a new package released this week.)


~Ethan~



More information about the Python-list mailing list