3
我可以使用套接字连接就好了,但是我听说当所有事情都是本地时,使用管道会更快,所以我想尝试一下,但是我无法获得连接。使用命名管道连接到LibreOffice
我开始与自由报
> soffice --headless --invisible --norestore --nodefault --nolockcheck --nofirstwizard --accept='pipe,name=ooo_pipe;urp;'
而且最低限度Python脚本,应该工作,但并不算
import uno
from com.sun.star.connection import NoConnectException
pipe = 'ooo_pipe'
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", localContext)
context = resolver.resolve("uno:pipe,name=%s;urp;StarOffice.ComponentContext" % pipe)
你是什么意思不起作用?你期望这个脚本做什么?你看到了什么呢? – subdir 2012-03-24 12:28:56