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


Groups > comp.lang.python > #6525

Re: How to catch a line with Popen

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <chris@rebertia.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.055
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'specifying': 0.07; 'python': 0.08; 'default.': 0.09; 'am,': 0.14; 'wrote:': 0.14; '\xc2\xa0if': 0.16; 'cc:addr:python-list': 0.17; 'cheers,': 0.19; 'header:In-Reply-To:1': 0.21; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; "i'm": 0.27; 'message-id:@mail.gmail.com': 0.28; 'subject:How': 0.30; 'cc:addr:python.org': 0.30; 'second': 0.30; 'catching': 0.30; 'sun,': 0.30; 'things': 0.33; 'rather': 0.34; "i'll": 0.34; 'chris': 0.34; 'nobody': 0.34; 'option': 0.35; 'not,': 0.35; 'received:google.com': 0.37; 'think': 0.38; 'received:74.125': 0.38; 'subject:: ': 0.38; 'skip:s 20': 0.39; 'subject:with': 0.39; 'strange': 0.68; 'subject:line': 0.73; '1/2': 0.84; 'roberts': 0.84; 'sender:addr:chris': 0.84; 'to:none': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:cc:content-type :content-transfer-encoding; bh=dkjrEFSsWOdP754p4Oy+nC0vAOyzcN0Ha21r7sFVZpw=; b=ITTLhweJYCp5lhA/2x6GBDhSxJXEk6bw8GHGnYV4vH9Z2O0a4qirnS0Bfivgzx3lhW 1U55dqPjPqHCxcVjFhIQSOAyjsPmG0QJF7p3YM7WSy3M3UCB6jIENDO25J899YfKj7LE 6QYDO0zhcs5PdNuwYbo77DHnbAC+zg1xlAXYQ=
DomainKey-Signature a=rsa-sha1; c=nofws; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:cc:content-type :content-transfer-encoding; b=Q6vfGg7a6bKuJMa20u+6dnUJzG7/EfW0j+qFX1elWOhHWBoIfo0SukKzvxzVNBViQz tcyo7e74DCA33cZlbLmevhXNwQHfW/jN1uKD11qO162+gbvTGMLIq7w4h8okLJlJfZrz vqr5Ici63vUcyoG4B1IR95r78mq9CCOw837yU=
MIME-Version 1.0
Sender chris@rebertia.com
In-Reply-To <irt5k2$h7v$1@speranza.aioe.org>
References <irr69j$6c1$1@speranza.aioe.org> <gd13u695qlqop8c7r53kg3sf12tgtolspm@4ax.com> <irt5k2$h7v$1@speranza.aioe.org>
Date Sun, 29 May 2011 03:26:49 -0700
X-Google-Sender-Auth jSTmVSAWc3AF49o9C-epD2h9hiU
Subject Re: How to catch a line with Popen
From Chris Rebert <clp2@rebertia.com>
Cc python-list@python.org
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
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.2219.1306664812.9059.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 82.94.164.166
X-Trace 1306664812 news.xs4all.nl 49182 [::ffff:82.94.164.166]:48664
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:6525

Show key headers only | View raw


On Sun, May 29, 2011 at 3:02 AM, TheSaint <nobody@nowhere.net.no> wrote:
> Tim Roberts wrote:
>
>> Are you specifying a buffer size in the Popen command?  If not, then the
>> Python side of things is unbuffered
>
> The buffer is as per default. The program reports one line around 1/2 second
> time.
> I think I'll look into the option as Nobody states:
>
>        p = subprocess.Popen(...)
>        for line in p.stdout:
>            ...
>        p.wait()
>
> It is strange that would take a for cycle, rather than catching the line on-
> the-fly. I can judge it now, I'm going to try it out.

What do you mean by "on-the-fly" in this context?

Cheers,
Chris

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


Thread

How to catch a line with Popen TheSaint <nobody@nowhere.net.no> - 2011-05-29 00:01 +0800
  Re: How to catch a line with Popen Nobody <nobody@nowhere.com> - 2011-05-28 23:15 +0100
  Re: How to catch a line with Popen Tim Roberts <timr@probo.com> - 2011-05-28 16:32 -0700
    Re: How to catch a line with Popen TheSaint <nobody@nowhere.net.no> - 2011-05-29 18:02 +0800
      Re: How to catch a line with Popen Chris Rebert <clp2@rebertia.com> - 2011-05-29 03:26 -0700
        Re: How to catch a line with Popen TheSaint <nobody@nowhere.net.no> - 2011-05-29 21:52 +0800
          Re: How to catch a line with Popen TheSaint <nobody@nowhere.net.no> - 2011-05-29 22:13 +0800
          Re: How to catch a line with Popen Chris Torek <nospam@torek.net> - 2011-05-30 01:02 +0000
            Re: How to catch a line with Popen TheSaint <nobody@nowhere.net.no> - 2011-05-30 23:29 +0800
              Re: How to catch a line with Popen Chris Torek <nospam@torek.net> - 2011-05-30 21:33 +0000
                Re: How to catch a line with Popen TheSaint <nobody@nowhere.net.no> - 2011-05-31 19:33 +0800

csiph-web