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