Ask Your Question

Configure Libreoffice to listen for uno connection

asked 2016-09-18 02:54:13 +0200

cellsee6 gravatar image

Running LibreOffice version on Windows 7 pro.

My understanding is if I write Python programs and run them externally to LibreOffice, then LibreOffice must be configured to listen for an uno connection.

How do I configure LibreOffice to listen for an uno connection?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-09-18 13:09:12 +0200

karolus gravatar image

updated 2017-02-14 16:54:00 +0200


See the answers in this thread
No, ipython notebook ( now jupyter notebook ) is not necessary to run soffice in servermode, but IMHO it's currently the best Environment for (small) interactiv Development from|with python.

to repeat the essential parts:

# run soffice as 'server'
from subprocess import Popen

officepath = 'soffice' #respectivly the full path
calc = '--calc'
pipe = "--accept=pipe,name=abraxas;urp;StarOffice.Servicemanager"
Popen([officepath, calc, pipe]);

# to connect as client
import uno
from pythonscript import ScriptContext

local = uno.getComponentContext()
resolver = local.ServiceManager.createInstance("")

client = resolver.resolve( "uno:pipe,"
# for the conviniance of prior basic-adopters
createUnoService = client.ServiceManager.createInstance

# for (roughly) the same namespace as from "inside" soffice
XSCRIPTCONTEXT = ScriptContext(client, None, None)
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-09-18 02:54:13 +0200

Seen: 1,515 times

Last updated: Feb 14 '17