From the documentation:
On Unix with shell=True, the shell defaults to /bin/sh. If args is a string, the string specifies the command to execute through the shell.
If args is a sequence, the first item specifies the command string, and any additional items will be treated as additional arguments to the shell itself.
Here, you should just remove shell=True
to pass the arguments to soffice
instead of passing the arguments to the shell:
subprocess.Popen(command)
To use shell=True
, you need to build all arguments into a single command (arguments would need to be escaped of course):
subprocess.Popen(command.join(' '), shell=True)