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

venutaurus539 at gmail.com venutaurus539 at gmail.com
Thu Feb 26 09:00:03 EST 2009


On Feb 26, 6:10 pm, Tim Wintle <tim.win... at teamrubber.com> wrote:
> On Thu, 2009-02-26 at 04:55 -0800, venutaurus... 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.

Thanks for the reply,
           Being a newbie to python, I am finding it difficult to
understand the logic even after thorough reading of comments. Is there
any simpler way where I can just run a python script from the main
script and exit without disturbing the second one(This will end based
on some other constraints which can be handled). Or can some one throw
some light on where should I run the function os.system(" python
script2.py") from the main one.

Thank you,
venu



More information about the Python-list mailing list