Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


Peter Morgan wrote:
import LibreOffice as LO

spread_full_path = "/jobs/%s/my_calc_spread_sheet.odf" % JOB.job_id #
whatever extension

spreadMe = LO.open(spread_full_path)

mySheet = spreadMe.sheet("foo", create=True) # create's if not exist,
otherwise error

mySheet.append( My_Data )

mySheet.close()

Hi Pete,

well you can use the normal Calc API also via Python, if Danny's
wrappers are not enough - it's almost as easy:

import uno, unohelper
...
oDoc = desktop.loadComponentFromURL( "file.ods", "_blank", 0, () )
oSheet = oDoc.getSheets().getByName( "My Sheet" )
oSheet.Rows.getByIndex(2).CellBackColor = long('00EEEEEE', 16)
...

etc - more details, bootstrapping tips etc here: 

http://wiki.services.openoffice.org/wiki/Python

(http://www.linuxjournal.com/content/starting-stopping-and-connecting-openoffice-python
may be a nice concise intro text)

In conclusion:
Anyone into developing the python.API and making it simple and idiot proff

The "python API" is the normal LibO API, i.e. the same for Java,
Basic, Python etc - the python binding works well for me, Danny's
wrapper is nice - but he's the one to be asked for development
there.

Cheers,

-- Thorsten

Attachment: pgp3RCdKQcuwp.pgp
Description: PGP signature


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.