I have a function which I call a progarm, with some args and want to get the result.
When I use the following
proc = subprocess.call(["fetch.py", "--cookies=/tmp/tmp-cookies"], stdout=PIPE, stderr=PIPE)
stdout, stderr = proc.communicate()
return stdout
The app just hangs.
But if I run
return subprocess.call(["fetch.py", "--cookies=/tmp/tmp-cookies"])
then I get the output on my screen and the app works fine, however I need to get the output into a function.
I am using python 2.6.1, and unable to use check_output
As the spec says,
What you need instead, is
subprocess.Popen:(Also,
subprocess.calldoes not return the process object, only exit status)