Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.pionier.net.pl!feed.xsnews.nl!border03.ams.xsnews.nl!feeder03.ams.xsnews.nl!abp001.ams.xsnews.nl!frontend-F10-16.ams.news.kpn.nl From: Cecil Westerhof Newsgroups: comp.lang.python Subject: Re: Why does the first loop go wrong with Python3 Organization: Decebal Computing References: <878uckvjoy.fsf@Equus.decebal.nl> <874mn8vd8n.fsf@Equus.decebal.nl> X-Face: "(y8cC@tg_12{">GF'UXTW]FHI2wMiZNrnf'1EFQ&O#$m:f#O7+7}kR,v+Pti8=Vi/Z"g^?b"E X-Homepage: http://www.decebal.nl/ Date: Tue, 19 May 2015 18:39:38 +0200 Message-ID: <87wq04ttbp.fsf@Equus.decebal.nl> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:89ofGBoFgUuWj6kChYBQ40ZU6IM= MIME-Version: 1.0 Content-Type: text/plain Lines: 30 NNTP-Posting-Host: 81.207.62.244 X-Trace: 1432053927 news.kpn.nl 21130 81.207.62.244@kpn/81.207.62.244:48831 Xref: csiph.com comp.lang.python:90870 Op Tuesday 19 May 2015 17:49 CEST schreef Ian Kelly: > On Tue, May 19, 2015 at 8:44 AM, Cecil Westerhof wrote: >> I looked at the documentation. Is it necessary to do a: >> p.wait() >> afterwards? > > It's good practice to clean up zombie processes by waiting on them, > but they will also get cleaned up when your script exits. You are right. I played a little with ipython3, which made finding things out a lot easier. ;-) In my case it is a script, that terminates very soon after being finished with p, but it is certainly good practise to do it myself. I always did a free in my C programming days. I was always told it was not necessary, but I found it better to do it anyway. By the way, what also works is: p = None But it was just a try in ipython3. I would never do this in real code. I was just curious if this would be handled correctly and it is. :-) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof