我使用这个命令来启动 openoffice:
soffice --accept="socket,host=localhost,port=8100;urp;StarOffice.Service" --headless --nofirststartwizard
以下命令将确保 openoffice 接受端口 8100 上的连接:
netstat -nap | grep office
输出:
tcp 0 0 127.0.0.1:8100 0.0.0.0:* LISTEN 2467/soffice.bin
启动openoffice进程的Python脚本:
command = [
'soffice',
'--accept=socket,host=localhost,port=8100;urp;StarOffice.Service',
'--headless',
'--nofirststartwizard'
]
subprocess.Popen(command, shell=True)
出于某种原因,当我尝试使用此 python 脚本启动 openoffice 时,netstat 命令不会输出任何内容。该过程在那里,但它不接受连接。我究竟做错了什么 ?