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


Groups > comp.lang.python > #43064

Re: subprocess question re waiting

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <dylan@dje.me>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.017
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; '&quot;the': 0.07; 'alain': 0.09; 'subject:question': 0.10; 'cc:addr:python-list': 0.11; 'command,': 0.16; 'finish.': 0.16; 'it."': 0.16; 'it.&quot;': 0.16; 'wrote:': 0.18; 'users.': 0.18; 'email addr:gmail.com&gt;': 0.22; 'shell': 0.22; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'cc:2**0': 0.24; 'script': 0.25; '&gt;': 0.26; 'header:In-Reply- To:1': 0.27; 'unix': 0.29; 'andrew': 0.30; 'message- id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'code': 0.31; 'writes:': 0.31; 'run': 0.32; 'url:python': 0.33; '"the': 0.34; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'url:org': 0.36; 'pm,': 0.38; 'does': 0.39; 'url:mail': 0.40; 'how': 0.40; 'nobody': 0.68; 'received:mail-ob0-x22d.google.com': 0.84; 'to:none': 0.92; '2013': 0.98
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:x-originating-ip:in-reply-to:references :date:message-id:subject:from:cc:content-type:x-gm-message-state; bh=9y19hGS+cli6qDS6cuhsnt0Lou9qe2CQZlRbnaqh5f8=; b=gOiAYCu4XUohaDfdMnA69jqRSoRglOAo+//D4ADGEjDLhO6o+WMhdiXLhJMxUwGD4l lDLZp7R2NRoYJPPPi2gd60trTKuy8keWUDZu+yUi372pOWLtw3zw3hyEdlDj1f0znlmC VyGmxMYnC5mmnY3GjRFeboh58U8rh5KH0xRXMepXPvGXZl0qTJTFTp6ZO0Nk8DjnVLiK DJRlHWZKPbBl+2FzW665OodgKHBzBPajlnyG80cCJyTjfaFZmiyiUZ4hmwvG8sgdmSQq GlvoBUXBc6L0KNoklUbFz7REORnbWYNEKUKWjxWst0ovYQYAAlT/OUbnN3NtyMXhGUev bgrw==
MIME-Version 1.0
X-Received by 10.182.134.230 with SMTP id pn6mr15062341obb.19.1365422512620; Mon, 08 Apr 2013 05:01:52 -0700 (PDT)
X-Originating-IP [220.245.216.139]
In-Reply-To <8761zxdyzb.fsf@dpt-info.u-strasbg.fr>
References <ed0010ee-471d-4cbe-ae6c-1d9a172b2ffc@googlegroups.com> <8761zxdyzb.fsf@dpt-info.u-strasbg.fr>
Date Mon, 8 Apr 2013 22:01:52 +1000
Subject Re: subprocess question re waiting
From Dylan Evans <dylan@dje.me>
Cc python-list <python-list@python.org>
Content-Type multipart/alternative; boundary=001a11c2bf80d558f404d9d83300
X-Gm-Message-State ALoCoQlkISvzKYlZVCejyAQ69AFchwMMolQpNmD3jw5kIORWAf6z2W2wZQ5OW7R9va9n6i/PspvR
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.284.1365422522.3114.python-list@python.org> (permalink)
Lines 75
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1365422522 news.xs4all.nl 6900 [2001:888:2000:d::a6]:36133
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:43064

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, Apr 8, 2013 at 9:48 PM, Alain Ketterlin <alain@dpt-info.u-strasbg.fr
> wrote:

> loial <jldunn2000@gmail.com> writes:
>
> > I want to call a child process to run a shell script and wait for that
> > script to finish. Will the code below wait for the script to finish?
> > If not then how do I make it wait?
> [...]
> > process = subprocess.Popen(command,
> stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=subprocess.PIPE,
> close_fds=True, shell=True)
>
> process.wait()
>

Or use subprocess.call instead which does what you want.


> -- Alain.
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
"The UNIX system has a command, nice ... in order to be nice to the other
users. Nobody ever uses it." - Andrew S. Tanenbaum

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


Thread

subprocess question re waiting loial <jldunn2000@gmail.com> - 2013-04-08 04:00 -0700
  Re: subprocess question re waiting Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2013-04-08 13:48 +0200
    Re: subprocess question re waiting Dylan Evans <dylan@dje.me> - 2013-04-08 22:01 +1000
    Re: subprocess question re waiting Dave Angel <davea@davea.name> - 2013-04-08 08:22 -0400
    Re: subprocess question re waiting Dylan Evans <dylan@dje.me> - 2013-04-08 22:58 +1000
  Re: subprocess question re waiting Dave Angel <davea@davea.name> - 2013-04-08 08:25 -0400

csiph-web