Hi,
I have a cgi script that performs a very long computation that can
take several hours to complete. Is there any smart way that I can keep
this script running until it is finished (after the user has closed
the browser) and email them with the results. The email bit isn't the
problem, I just don't know how to keep the code running in the
background. I'm sure there is a smart way to do this...
Thanks! 3 2413
On Mar 7, 10:28 am, sophie_newbie <paulgeele...@gmail.comwrote:
Hi,
I have a cgi script that performs a very long computation that can
take several hours to complete. Is there any smart way that I can keep
this script running until it is finished (after the user has closed
the browser) and email them with the results. The email bit isn't the
problem, I just don't know how to keep the code running in the
background. I'm sure there is a smart way to do this...
Thanks!
You might have your cgi script use the subprocess module to open a
second script that does the long-running process.
Mike
On Mar 7, 4:33 pm, Mike Driscoll <kyoso...@gmail.comwrote:
On Mar 7, 10:28 am, sophie_newbie <paulgeele...@gmail.comwrote:
Hi,
I have a cgi script that performs a very long computation that can
take several hours to complete. Is there any smart way that I can keep
this script running until it is finished (after the user has closed
the browser) and email them with the results. The email bit isn't the
problem, I just don't know how to keep the code running in the
background. I'm sure there is a smart way to do this...
Thanks!
You might have your cgi script use the subprocess module to open a
second script that does the long-running process.
Mike
Ya it looks like:
import subprocess
# spawn subprocess
subprocess.Popen(["python", "spawn.py"])
Should do this job, where spawn.py is the script to do the job.
Thanks.
On Mar 10, 1:42 pm, sophie_newbie <paulgeele...@gmail.comwrote:
On Mar 7, 4:33 pm, Mike Driscoll <kyoso...@gmail.comwrote:
On Mar 7, 10:28 am, sophie_newbie <paulgeele...@gmail.comwrote:
Hi,
I have a cgi script that performs a very long computation that can
take several hours to complete. Is there any smart way that I can keep
this script running until it is finished (after the user has closed
the browser) and email them with the results. The email bit isn't the
problem, I just don't know how to keep the code running in the
background. I'm sure there is a smart way to do this...
Thanks!
You might have your cgi script use the subprocess module to open a
second script that does the long-running process.
Mike
Ya it looks like:
import subprocess
# spawn subprocess
subprocess.Popen(["python", "spawn.py"])
Should do this job, where spawn.py is the script to do the job.
Thanks.
In real life, you probably want spawn.py to do a full daemonize. That
means fork/setsid/fork/chdir appropriately/deal with stdin/stdout/
umask, or however you set up a service on Windows. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Sam |
last post by:
Only 2 weeks messing around with it ( thanks to programs like SYNCHRONEX and
BITORRENT ), and already trying to create windows ( the paths are just too long
for me to want to type them ).
After...
|
by: Kurt B. Kaiser |
last post by:
Patch / Bug Summary
___________________
Patches : 241 open ( -6) / 2622 closed (+26) / 2863 total (+20)
Bugs : 764 open ( +6) / 4453 closed (+38) / 5217 total (+44)
RFE : 150 open...
|
by: LarsenMTL |
last post by:
Python Users:
Based on previous suggestions from this group, I'm attempting to write
a python CGI that takes input from an HTML form, invokes a second
python script using this input, tells the...
|
by: Simon Fletcher |
last post by:
Hello there,
I need a "Close Window" script ( onLoad.Close.Window() ), however i need the
script so it don't come up with this annoying window:
"This window is trying to close" window.
Is...
|
by: Wentink |
last post by:
Does anybody have a simple script that let's me popup a picture from a
thumbnail?
The ones i found are all very very complicated and messy in the source...
Thanks,
Tintin
| |
by: Hal |
last post by:
Can someone please tell me what is wrong with this script?
<script language="JavaScript">
<!--
function HF_CloseAllChildren() {
if (g_win1) != undefined {
if ((g_win1) && !(g_win1.closed))...
|
by: Kurt B. Kaiser |
last post by:
Patch / Bug Summary
___________________
Patches : 391 open ( +7) / 3028 closed (+12) / 3419 total (+19)
Bugs : 906 open ( -3) / 5519 closed (+19) / 6425 total (+16)
RFE : 207 open...
|
by: adamurbas |
last post by:
ya so im pretty much a newb to this whole python thing... its pretty
cool but i just started today and im already having trouble. i
started to use a tutorial that i found somewhere and i followed...
|
by: apurvaG |
last post by:
Hi All,
I wanted to know, can I check in action script whether the browser window which loads my swf file has been closed? Basically I wanted to call a action script function which will be...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |