I have a python script that needs to run other software multiple times, I'm trying to do this using the .system ("command"), but this function always returns me -1 and it does not work, / p>
PS I'm using python 2.7
I have a python script that needs to run other software multiple times, I'm trying to do this using the .system ("command"), but this function always returns me -1 and it does not work, / p>
PS I'm using python 2.7
You can use another Python routine called subprocess.call
.
It avoids many issues related to quotation marks and conventions between different operating system shells. The command is passed using a list, instead of a string, the first element being the command and the next parameters.
Example
import subprocess
subprocess.call(['Notepad.exe', 'C:\temp\test.txt'])