Asychronous execution *with* return codes?

utabintarbo utabintarbo at
Thu Oct 5 14:33:04 CEST 2006

I hope I have not overlooked a solution already posted, but I seem to
be unable to suss out a way to achieve both multiple console-less
executions of a given (console) application and gathering the return
code from the application.

What I have found:
import subprocess

# gives back return code, but does not run asynchronously
retcode =[app, lstArgs])
retcode = subprocess.Popen([app] + lstArgs).wait()
# runs the app async, but only returns the pid (no return code)
pid = subprocess.Popen([app] + lstArgs).pid

Is there some magic elixir which will get me both?


More information about the Python-list mailing list