Run a python script as an exe and run a new process from it

Tim Wintle tim.wintle at teamrubber.com
Thu Feb 26 08:10:15 EST 2009


On Thu, 2009-02-26 at 04:55 -0800, venutaurus539 at gmail.com wrote:
> Hello all,
>            I've a strange requirement where I need to run a python
> script just as we run an exe (by double clicking through windows
> explorer or by typing the script name at command prompt).
I don't know how windows deals with this part
>  In that
> process I should be able to execute another python script in such a
> way that, the second script should continue running but the main one
> should terminate without effecting the second one.
standard daemon behavior I'd have thought

This shows how you would do it (with lots of comments). Assume this
should work on Windows.

http://code.activestate.com/recipes/278731/

note the two child threads to prevent zombies - may not be needed on
windows but good to use them anyway.




More information about the Python-list mailing list