I have a python web application that needs to launch a long running process. The catch is I don’t want it to wait around for the process to finish. Just launch and finish.
I’m running on windows XP, and the web app is running under IIS (if that matters).
So far I tried popen but that didn’t seem to work. It waited until the child process finished.
Ok, I finally figured this out! This seems to work:
Note: I added shell=True. Otherwise calling print in the child process gave me the error “IOError: [Errno 9] Bad file descriptor”
DETACHED_PROCESSis a Process Creation Flag that is passed to the underlying WINAPI CreateProcess function.