I am trying to write a small app that uses the subprocess
module.
My program calls an external Bash command that takes some time to process. During this ti
@extraneon's answer is a little backwards. Both wait()
and poll()
return the process's exit code if the process has finished. The poll()
method will return None
if the process is still running and the wait()
method will block until the process exits:
Check out the following page: https://docs.python.org/3.4/library/subprocess.html#popen-objects
Popen.poll()
Check if child process has terminated. Set and return returncode attribute.
Popen.wait()
Wait for child process to terminate. Set and return returncode attribute.