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


Groups > comp.lang.python > #35081

Re: os.system and subprocess odd behavior

Date 2012-12-19 10:03 +1100
From Cameron Simpson <cs@zip.com.au>
Subject Re: os.system and subprocess odd behavior
References <50D047FC.6050406@davea.name>
Newsgroups comp.lang.python
Message-ID <mailman.1035.1355871807.29569.python-list@python.org> (permalink)

Show all headers | 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