Pyhton hello world, import uno Fehler

Hallo,
ich möchte Makro schreiben die libreoffice steuern.
Aber alle Hello-Worlds geben Fehler.

Abgesehen davon, dass ich nicht weiß, wie ich eigentlich anfangen soll (Gerne noch Tipps dazu), misslingen die ersten Schritte.
Von hier kommt das Hello-World
http://oosheet.hacklab.com.br/using-oosheet.html#hello-world
Keine Ahnung ob es was passenderes gibt, jedenfalls scheint irgendwas nicht zu funktionieren.

Was könnte man noch versuchen?

Danke im Voraus

kubuntu 13.10

kubuntu@kubuntu:~$ python
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import uno
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named uno

Also ich füge mal bei was ich im chat here auf Englisch noch zu Thema ausgeführt habe:
17:53:38 teobo I did everything what was mentioned in the tut…
17:55:30 teobo install oosheet via pip and python-uno
17:55:34 teobo apt-get install libreoffice-script-provider-python
17:55:48 awerner has quit: Quit: Leaving.
17:56:09 teobo say said it was replaced
17:56:45 teobo then I put the first line of hello world from oosheet import OOSheet as S
17:57:26 teobo and got error message: …ImportError: No module named uno
17:57:46 teobo thats it
17:59:08 lg__ teobo: did you launch $ libreoffice -calc -accept=“socket,host=localhost,port=2002;urp;StarOffice.ServiceManager”
18:00:15 teobo yes
18:08:12 teobo here it says https://code.google.com/p/slidespeech/wiki/FindingLibreOfficePython
18:08:30 teobo Debian based systems LibreOffice uses the system python, so “import uno” will “just work”
18:11:37 teobo but it does not, is anybody experiencing the same?
1

Nachdem ich eine Weile im Chat war und einige Rückkopplungen bekommen habe, stellt sich die Sache so dar:
oosheet, das ich benutzt hatte war nicht für die python version ausgelegt, die Ubuntu für die libreoffice - Python -Brücke vorgesehen hatte:3.0
Also versuche ich ein Hello World ohne oosheet:
http://www.openoffice.org/udk/python/python-bridge.html
das auch für libreoffice angewandt werden kann. Man muss nur die Begriffe jeweils austauschen. …Und das klappte erstmal.

Checked this on Ubuntu 14.04 LTS. If you have python3-uno installed and start LibreOffice with:

libreoffice "--accept=socket,host=localhost,port=2002;urp;"

then put this in a HelloWorld.py file:

import uno    
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext(
                "com.sun.star.bridge.UnoUrlResolver", localContext )
ctx = resolver.resolve( "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
smgr = ctx.ServiceManager
desktop = smgr.createInstanceWithContext( "com.sun.star.frame.Desktop",ctx)
model = desktop.getCurrentComponent()    
if not hasattr(model, "Text"):
    model = desktop.loadComponentFromURL(
        "private:factory/swriter","_blank", 0, () )
text = model.Text
cursor = text.createTextCursor()
text.insertString( cursor, "Hello World", 0 )
ctx.ServiceManager

and run it with python3 ./HelloWorld.py it works just fine. Note that I added the hasattr(model, "Text") check to see if the current component is a text document and if not (e.g. if its the start center), create one.