See the answers in this thread
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
from pythonscript import ScriptContext
local = uno.getComponentContext()
resolver = local.ServiceManager.createInstance("com.sun.star.bridge.UnoUrlResolver")
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)