File: calc-example07.py

package info (click to toggle)
ooolib-python 0.0.13-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 164 kB
  • ctags: 87
  • sloc: python: 1,606; makefile: 39
file content (19 lines) | stat: -rwxr-xr-x 702 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/python

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, "string", str(col * row))
		doc.set_cell_value(col, row, "annotation", "Annotation:" + str(col*row))
		doc.set_cell_value(col, row, "link", ('file:///c:\\tmp\\content.xml', 'My Link'))
doc.set_cell_value(1, 9, "link", ('http://ooolib.sourceforge.net/', 'ooolib'))

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