spawn() problem

bob bvdpoel at
Fri Jan 17 19:04:50 CET 2003

I using a tkinter program to launch some console-type programs. Works 
fine, almost.

I have a command something like:

	PID = os.spawnlp(os.P_NOWAIT, myprog, myprog, f)

So, this now runs in the backgound. Fine.

I've got an 'abort' button which uses the PID to kill the spawned program:

	os.kill(PlayPID, signal.SIGQUIT)

Again, no problem. Even if the program has already terminated.

But, there are some other clean up things I'd like to do only if the 
program has not exited. So, what I need to do is to signal something 
when the program terminates. And that part I can't figure out.

I tried:

	PID = os.spawnlp(os.P_NOWAIT, myprog, myprog, f)

but that seems to block the entire GUI.


Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: bvdpoel at

More information about the Python-list mailing list