Hello,
Out of curiosity, is this the simplest way in Python3 to run an external command-line application with parameters?
Thank you.
Out of curiosity, is this the simplest way in Python3 to run an external command-line application with parameters?
Thank you.
1 2 3 4 5 6 7 8 9 10 11 |
from subprocess import Popen, PIPE import shlex command_line = "command -a 50 -o %03d.jpg input.doc" args = shlex.split(command_line) args.insert( 0 , r "C:\app.exe" ) process = Popen(args,stdout = PIPE, stderr = PIPE) stdout, stderr = process.communicate() print (stdout) |