How to execute shell command in Python program?
Madhavan Bomidi wrote:
> import subprocess
subprocess.call(['./opac', "my-input.inp"], shell=True)
The array takes command with a list of arguments. This
way you don't need to do space escaping and other
If you want to feed the command from stdin, this becomes a bit
more complicated as you need to start a subprocess and use
PIPE to feed it.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: OpenPGP digital signature