Hallo
What do you mean by IPython notebook, this one?
[1]Yes, it is.
[1]in this case mostly out of the box with the .deb packages from
http://www.libreoffice.org/download/libreoffice-fresh/
It installs to
/opt/libreoffice4.3/
Only for
IPython notebook i need to extend PYTHONPATH in
/opt/libreoffice4.3/program/python:
...
PYTHONPATH=$sd_prog:$sd_prog/python-core-3.3.3/lib:$sd_prog/python-core-3.3.3/lib/lib-dynload:$sd_prog/python-core-3.3.3/lib/lib-tk:$sd_prog/python-core-3.3.3/lib/site-packages:
$HOME/miniconda3/envs/note/lib/python3.3:$HOME/miniconda3/envs/note/lib/python3.3/lib-dynload:/usr/local/lib/python3.3/dist-packages${PYTHONPATH+:$PYTHONPATH}
...
First i start the notebook via commandline:
Code: Select all
/opt/libreoffice4.3/program/python -m IPython notebook
from notebook i use to start soffice as server:
Code: Select all
from subprocess import Popen
officepath = '/opt/libreoffice4.3/program/soffice'
calc = '--calc'
pipe = "--accept=pipe,name=abraxas;urp;StarOffice.Servicemanager"
Popen([officepath,calc, pipe])
and the connection to office-process with:
Code: Select all
import uno
local = uno.getComponentContext()
resolver = local.ServiceManager.createInstance("com.sun.star.bridge.UnoUrlResolver")
client = resolver.resolve("uno:pipe,"
"name=abraxas;"
"urp;"
"StarOffice.ComponentContext")
createUnoService = client.ServiceManager.createInstance
(desktop,
file_access,
pathsubstitution,
mri,
pipe,
textout,
textin,
contentfactory) = map( createUnoService,
("com.sun.star.frame.Desktop",
"com.sun.star.ucb.SimpleFileAccess",
"com.sun.star.util.PathSubstitution",
"mytools.Mri",
"com.sun.star.io.Pipe",
"com.sun.star.io.TextOutputStream",
"com.sun.star.io.TextInputStream",
"com.sun.star.frame.TransientDocumentsDocumentContentFactory")
)
(Here with some boilerplate, essentially in the last statement is only the
desktop