I would like to create a subprocess of a process.
What would be a working example which shows how to accomplish this?
This is what worked for me if you want to run a simple command instead of giving a seperate file
import subprocess
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
process.wait()
print process.returncode
To get returncode of process you can use process.returncode
To get response you can use process.communicate()
in case if you are confuse you can just test this code by using command="ls"
if you are getting returncode
other than 0
then you can check here what that error code means: http://tldp.org/LDP/abs/html/exitcodes.html
For more details about Subprocess: http://docs.python.org/library/subprocess.html