/usr/share/doc/python-ooolib/examples/calc-example06.py is in python-ooolib 0.0.17-2.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #!/usr/bin/python
import sys
sys.path.append('..')
import ooolib
# Create your document
doc = ooolib.Calc()
for row in range(1, 9):
doc.set_cell_value(1, row, "float", row)
doc.set_cell_value(2, 1, 'string', 'AVERAGE')
doc.set_cell_value(2, 2, 'string', 'MIN')
doc.set_cell_value(2, 3, 'string', 'MAX')
doc.set_cell_value(2, 4, 'string', 'SUM')
doc.set_cell_value(2, 5, 'string', 'SQRT')
doc.set_cell_value(2, 6, 'string', 'Condition')
doc.set_cell_value(3, 1, 'formula', '=AVERAGE(A1:A8)')
doc.set_cell_value(3, 2, 'formula', '=MIN(A1:A8)')
doc.set_cell_value(3, 3, 'formula', '=MAX(A1:A8)')
doc.set_cell_value(3, 4, 'formula', '=SUM(A1:A8)')
doc.set_cell_value(3, 5, 'formula', '=SQRT(A8)')
doc.set_cell_value(3, 6, 'formula', '=IF((A5>A4);A4;"")')
# Save the document to the file you want to create
doc.save("calc-example06.ods")
|