I use this command to start openoffice:
soffice --accept="socket,host=localhost,port=8100;urp;StarOffice.Service" --headless --nofirststartwizard
The following command will ensure that openoffice is accepting connections on port 8100:
netstat -nap | grep office
output:
tcp 0 0 127.0.0.1:8100 0.0.0.0:* LISTEN 2467/soffice.bin
Python script to start openoffice process:
command = [
'soffice',
'--accept=socket,host=localhost,port=8100;urp;StarOffice.Service',
'--headless',
'--nofirststartwizard'
]
subprocess.Popen(command, shell=True)
For some reason, the netstat command outputs nothing when i try to start openoffice with this python script. the process is there, but it does not accept connections. What am i doing wrong ?
From the documentation:
Here, you should just remove
shell=True
to pass the arguments tosoffice
instead of passing the arguments to the shell:To use
shell=True
, you need to build all arguments into a single command (arguments would need to be escaped of course):