Run Process and Don’t Wait

This call doesn’t wait for the child process to terminate (on Linux). Don’t ask me what close_fds does; I wrote the code some years ago. (BTW: The documentation of subprocess.Popen is confusing, IMHO.)

proc = Popen([cmd_str], shell=True,
             stdin=None, stdout=None, stderr=None, close_fds=True)

Edit:

I looked at the the documentation of subprocess, and I believe the important aspect for you is stdin=None, stdout=None, stderr=None,. Otherwise Popen captures the program’s output, and you are expected to look at it. close_fds makes the parent process’ file handles inaccessible for the child.

Leave a Comment