Has anyone generated Open Office Calc XML files from python

vj vinjvinj at gmail.com
Thu Nov 16 19:32:37 CET 2006


>      http://ooopy.sourceforge.net/

I downloaded the package. unfortunately there are no examples that come
with. I found another python package which is more geared to creating
simple calc objects from python at. Apparently it is a port of the perl
library.

http://sourceforge.net/project/showfiles.php?group_id=87437

Here is one of the examples from the library. Seems pretty simple and
exactly what I was looking for:

-----------------------------------------------------------------------
import ooolib

# Create your document
doc = ooolib.Calc()

# Set values.  The values are set in column, row order, but the values
are
# not in the traditional "A5" style format.  Instead we require two
integers.
# set_cell_value(col, row, datatype, value)
for row in range(1, 9):
	for col in range(1, 9):
		doc.set_cell_value(col, row, "float", col * row)

# Save the document to the file you want to create
doc.save("calc-example01.ods")

-----------------------------------------------------------------------
VJ




More information about the Python-list mailing list