I have a small Python CGI script running as an intranet app. One of
the things the script needs to do is allow users to save invoices.
This is a process that takes about 60 seconds once the user submits
the order from the web app.
Ideally I'd like the CGI script to kick off a process to save the
invoice but not wait until it's finished to render the page. What's
the best way to do this, a thread, call a separate program from
os.system, something else?
Thanks in advance for the help.
-Greg
But a thread leaves the script running until the thread exits, right?
So the webpage would just keep saying "loading" at the bottom I think.
-Greg
give it a shot. if you spawn off a new thread your code should keep
executing while the thread does its work in the "background".
That's the thing though, I don't want my code to keep executing, I
want the script to exit/finish completely.
I'm leaning towards os.startfile right now. I also see some os.spawn
beasties in there but I don't understand those.
-Greg
Can you tell the page to auto-refresh itself every 15 seconds or so? I
have seen this as a user but don't know if it is special html code or
javascript or java or what.
tjr
> Can you tell the page to auto-refresh itself every 15 seconds or so? I
> have seen this as a user but don't know if it is special html code or
> javascript or java or what.
>
> tjr
That's a good point. I'll check into that. If not it looks like I'll
be going with os.spawn.
This will sort of emulate the stop button, that might work:
http://www.thescripts.com/forum/thread601992.html
-Greg
Try the subprocess module
--
Aahz (aa...@pythoncraft.com) <*> http://www.pythoncraft.com/
"I disrespectfully agree." --SJM