By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,822 Members | 1,055 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,822 IT Pros & Developers. It's quick & easy.

Re: Defunct when using subprocess.Popen

P: n/a
En Tue, 29 Jul 2008 10:04:46 -0300, Gordon Maria
<Ma**********@afconsult.comescribi�:
I'm running a GUI in python which is able to launch a separate python
process
that will run forever. In rare cases I will want to kill the launched
process.
Every time I do so, I end up with the process as defunct. Can anybody
help me
clean it up in a nice way?

On request from GUI I do the following:
os.kill(process.pid,9)

FYI, it is all running on Linux.
You should call os.waitpid() after killing the child process, to let the
OS free the resources allocated to it.

--
Gabriel Genellina

Jul 30 '08 #1
Share this Question
Share on Google+
1 Reply

P: n/a
On Wed, 30 Jul 2008 01:56:28 -0300, Gabriel Genellina wrote:
You should call os.waitpid() after killing the child process, to let the
OS free the resources allocated to it.
The subprocess.Popen object supports a 'wait' method directly.
Jul 30 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.