I've seen write-ups but am not sure how to apply this to my example. I want to be able to push a button on my webpage, run a piece of python code -- and within the python code it runs another process (executable). The executable takes time, so I want the webpage to not wait until the executable is done running.
I have seen things on daemon and forks, but am not sure how to implement them. I am running an Apache Server with Python CGI on a Windows 8 machine.
Currently, my python code runs and the executable runs fine, but the web page waits until the exe is done processing before updating with an alert window that the "Request has been submitted". Here is my popen code as it is now:
p = subprocess.Popen(['test_sendemail.exe',cmd],shell=False,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
Again, everything works fine here, but I need the python script to end even though the exe is running so that it can update the webpage and move on. (once the exe is done running, it fires an email off with results -- which is why I don't want to wait on the webpage for it to finish).
Any thoughts? Thanks!