how to call a program from python without waiting for it to return how to call a program from python without waiting for it to return python python

how to call a program from python without waiting for it to return


Under Windows, if you invoke the program using the shell START command you should be able to "release" the parent process and allow it to exit. Try START /? at the DOS prompt to learn more.


By using poll() instead of wait() on Popen it will not block and it won't wait for the program to run. However, I think the only way to really stop the entire program from waiting is by creating a daemonic thread which starts the process. That way you'll never have to wait for it.

class MyThread(threading.Thread):    def run(self):        '''Start your thread here'''        passthread = MyThread()thread.daemon = Truethread.start()