programs exit?

Karl M. Syring syring at email.com
Sat Jan 19 17:49:44 EST 2002


"maximilianscherr" <MaximilianScherr at T-Online.de> schrieb im Newsbeitrag
news:mailman.1011469617.32012.python-list at python.org...
> thanks, but i need to do stuff between starting and exitting:(
>
> any possibility?
>
> (sorry for possible double posts)
>
> --- In python-list at y..., "Karl M. Syring" <syring at e...> wrote:
> > "maximilianscherr" <MaximilianScherr at T...> schrieb im Newsbeitrag
> > news:mailman.1011440069.23362.python-list at p...
> > > Thanks but hmmm, doesn't work:)
> > > I'm using windows:( how can i get to know when a program exits
> there?
> >
> > By using the result = os.spawnv(os.P_WAIT, command, args). In your
> program,
> > there is no reason to use os.P_NOWAIT.

You can use the Thread class from the threading module. Do the spawn with
the P_WAIT flag. Synchronization automatically happens on the Thread.join()
call.

Karl M. Syring





More information about the Python-list mailing list