Re: get the en of a program running in background

2006-09-11 Thread awalter1
Hi, I am using subprocess module, then I do not fork my program. How use os.wait() in a non blocking mode ? Thanks Damjan wrote: > > It works when a click on a button launches a program P. > > Now, I want that a click on another button launches another program P' > > > > In this case there is only

Re: get the en of a program running in background

2006-09-11 Thread Damjan
> It works when a click on a button launches a program P. > Now, I want that a click on another button launches another program P' > > In this case there is only one signal for two events : the end of P and > the end of P'. > How can distinct the two cases. Remember the PIDs of the forked proces

Re: get the en of a program running in background

2006-09-11 Thread awalter1
Hi, It works when a click on a button launches a program P. Now, I want that a click on another button launches another program P' In this case there is only one signal for two events : the end of P and the end of P'. How can distinct the two cases. In addition, what is the use of the frame para

Re: get the en of a program running in background

2006-09-11 Thread awalter1
Thanks a lot. It does exactly what I expected and it's very simple oripel a écrit : > Module 'subprocess' may be a better fit for you than fork+exec. > Here's an example with a signal handler > (1) use subprocess, don't fork and exec > (2) maybe this will help: > > --- > import signal, subprocess

Re: get the en of a program running in background

2006-09-10 Thread oripel
Module 'subprocess' may be a better fit for you than fork+exec. Here's an example with a signal handler (1) use subprocess, don't fork and exec (2) maybe this will help: --- import signal, subprocess # define the signal handler def logsignal(signum, frame): print "Caught signal" # register th

get the en of a program running in background

2006-09-10 Thread awalter1
Hi, I develop a graphical user interface (with pyGTK) where a click on a button shall launch a program P in background. I want to get the end of this program P but I don't want that my HMI be freezed while P is running. I try to use fork examplesI found on the web, but it seems to not run as expect