programs exit?

maximilianscherr MaximilianScherr at T-Online.de
Sat Jan 19 18:12:20 EST 2002


Thanks, 

but because im a total newbie, could you give me an example code for: 
launch a file, print something to the console, and when it is closed 
print "closed" to the console?



--- In python-list at y..., "Karl M. Syring" <syring at e...> wrote:
> "maximilianscherr" <MaximilianScherr at T...> schrieb im Newsbeitrag
> news:mailman.1011469617.32012.python-list at p...
> > 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
> 
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list