Re: killing all subprocess childrens

2010-09-02 Thread Lawrence D'Oliveiro
In message , Astan Chee wrote: > What I'm trying to do (and wondering if its possible) is to make sure > that any children (and any descendants) of this process is killed when > the main java process is killed (or dies). > How do I do this in windows, linux and OSX? A linux-specific solution cou

Re: killing all subprocess childrens

2010-09-02 Thread Chris Rebert
On Thu, Sep 2, 2010 at 12:58 PM, Aahz wrote: > In article , > Astan Chee   wrote: >>Chris Rebert wrote: >>> >>> import os >>> import psutil # http://code.google.com/p/psutil/ >>> >>> # your piece of code goes here >>> >>> myself = os.getpid() >>> for proc in psutil.process_iter(): >> >>Is there a

Re: killing all subprocess childrens

2010-09-02 Thread Aahz
In article , Astan Chee wrote: >Chris Rebert wrote: >> >> import os >> import psutil # http://code.google.com/p/psutil/ >> >> # your piece of code goes here >> >> myself = os.getpid() >> for proc in psutil.process_iter(): > >Is there a way to do this without psutil or installing any external

Re: killing all subprocess childrens

2010-09-02 Thread Nobody
On Thu, 02 Sep 2010 13:12:07 +1000, Astan Chee wrote: > I have a piece of code that looks like this: > > import subprocess > retcode = subprocess.call(["java","test","string"]) > print "Exited with retcode " + str(retcode) > > What I'm trying to do (and wondering if its possible) is to make sure

Re: killing all subprocess childrens

2010-09-01 Thread Astan Chee
Chris Rebert wrote: import os import psutil # http://code.google.com/p/psutil/ # your piece of code goes here myself = os.getpid() for proc in psutil.process_iter(): Is there a way to do this without psutil or installing any external modules or doing it from python2.5? Just wondering. Than

Re: killing all subprocess childrens

2010-09-01 Thread Chris Rebert
On Wed, Sep 1, 2010 at 8:12 PM, Astan Chee wrote: > Hi, > I have a piece of code that looks like this: > > import subprocess > retcode = subprocess.call(["java","test","string"]) > print "Exited with retcode " + str(retcode) > > What I'm trying to do (and wondering if its possible) is to make sure

killing all subprocess childrens

2010-09-01 Thread Astan Chee
Hi, I have a piece of code that looks like this: import subprocess retcode = subprocess.call(["java","test","string"]) print "Exited with retcode " + str(retcode) What I'm trying to do (and wondering if its possible) is to make sure that any children (and any descendants) of this process is kil