Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35081

Re: os.system and subprocess odd behavior

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <cameron@cskk.homeip.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'exit': 0.07; 'problem?': 0.07; 'rebuild': 0.09; 'cc:addr:python-list': 0.10; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'otoh,': 0.16; 'received:202.125.174': 0.16; 'received:202.125.174.133': 0.16; 'received:boardofstudies.nsw.edu.au': 0.16; 'received:cskk.homeip.net': 0.16; 'received:edu.au': 0.16; 'received:harvey.boardofstudies.nsw.edu.au': 0.16; 'received:homeip.net': 0.16; 'received:nsw.edu.au': 0.16; 'simpson': 0.16; 'task.': 0.16; 'wrote:': 0.17; "shouldn't": 0.17; 'issue.': 0.20; 'otherwise,': 0.20; 'cc:2**0': 0.23; 'task': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'done.': 0.27; 'initial': 0.28; 'cases,': 0.33; 'like:': 0.33; 'table': 0.35; 'something': 0.35; 'except': 0.36; 'but': 0.36; 'child': 0.36; 'received:au': 0.36; 'charset:us-ascii': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'performance': 0.39; 'content- disposition:inline': 0.60; 'email addr:gmail.com': 0.63; 'costs': 0.64; 'angel': 0.93
Date Wed, 19 Dec 2012 10:03:16 +1100
From Cameron Simpson <cs@zip.com.au>
To Dave Angel <d@davea.name>
Subject Re: os.system and subprocess odd behavior
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
In-Reply-To <50D047FC.6050406@davea.name>
User-Agent Mutt/1.5.21 (2010-09-15)
References <50D047FC.6050406@davea.name>
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1035.1355871807.29569.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1355871807 news.xs4all.nl 6898 [2001:888:2000:d::a6]:57938
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:35081

Show key headers only | View raw


On 18Dec2012 05:39, Dave Angel <d@davea.name> wrote:
| On 12/18/2012 05:27 AM, Hans Mulder wrote:
| > On 18/12/12 06:10:43, photonymous@gmail.com wrote:
| >> I hope I understand the question... but shouldn't you wait for the process to complete before exiting?
| >>
| >> Something like:
| >>
| >> pid = subprocess.Popen(...)
| >> pid.wait()
| >>
| >> Otherwise, it'll exit before the background process is done. 
| > Why would that be a problem?
| 
| Because you don't want to bog the system down with a zombie task.

A zombie task is just a process table slot; it costs the system almost
nothing. It is untidy but except in extreme cases, not a performance or
resource issue.

OTOH, a child process that is still active (pointlessly) might be a
problem...
-- 
Cameron Simpson <cs@zip.com.au>

My initial work-around is to rebuild history.
        - gary@sci34hub.sci.com (Gary Heston)

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: os.system and subprocess odd behavior Cameron Simpson <cs@zip.com.au> - 2012-12-19 10:03 +1100

csiph-web