Hello,

The easiest thing is probably to use one of the spawn[lv]
functions, in the os module. "If mode is P_NOWAIT, this function
returns the process ID of the new process..." and then, once
you have that process ID, you can kill() it. Which signal you
send depends on the program you've started, but a SIGTERM (15)
will usually work.

 - Jesse


Christopher Shaffer on June 3, 2003 wrote:
 > Feeling really dumb here...
 > 
 > Looked up Process management in the Python docs
 > (http://www.python.org/doc/current/lib/os-process.html), but I am unsure how get 
 > the process id
 > returned to me.  Here is my test code:
 > 
 > --------------------
 > #!/usr/bin/env python
 > import os
 > print "Starting process echo..."
 > result = os.execlp("echo","bobiscool","bobisnotcool")
 > print result
 > --------------------
 > 
 > the result that gets printed is "bobisnotcool", the output from my 'echo' statment. 
 >  How do obtain
 > the process id, and once I do that, what is my other parameter to kill(), besides 
 > the procID.
 > 
 > Thanks,
 > 
 > Chris Shaffer
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to