[Tutor] Multi-Dimensional Dictionary that contains a 12 element list.
billburns at pennswoods.net
Sat Dec 31 01:12:16 CET 2005
Paul Kraus wrote:
> Now I have to find a way to take the output at the end and pipe it
> out to an external Perl program that creates an excel spreadsheet (
> no real clean easy way to do this in python but hey each tool has its
> usefullness). I wish I could hide this in the object though so that I
> could call a "dump" method that would then create the spreadsheet. I
> will have to play with this later.
For the Excel portion of things, you may want to take a look at
I had never tried it (until I read your post), so I though I'd give it a
try. There are others on the list who have used it (John Fouhy & Bob
Gailer, I believe, maybe others??).
It seems very good a writing Excel files. It does not require COM or
anything such as that, but you will need Python 2.4. It is supposed to
run on both Windows and *nix (I've only tested it on Windows).
I've no idea what your output data looks like, but here's a small
example which uses the fields (from your previous code) and writes
them to an Excel file.
from pyExcelerator.Workbook import *
wb = Workbook()
ws0 = wb.add_sheet('Vendor_Sales')
fields = \
row = 0
col = -1
for field in fields:
col += 1
ws0.write(row, col, field)
It's a small download (approx. 260 KB) and easy to install
(python setup.py install).
It seems a little 'light' in the documentation area, but there are
various examples in the zip file.
More information about the Tutor