File: calc-example01.py

package info (click to toggle)
ooolib-python 0.0.17-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 168 kB
  • ctags: 101
  • sloc: python: 1,731; makefile: 40
file content (18 lines) | stat: -rwxr-xr-x 491 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python

import sys
sys.path.append('..')
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")