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: 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: References: 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Sun, May 29, 2011 at 3:02 AM, TheSaint wrote: > Tim Roberts wrote: > >> Are you specifying a buffer size in the Popen command? =C2=A0If not, the= n the >> Python side of things is unbuffered > > The buffer is as per default. The program reports one line around 1/2 sec= ond > time. > I think I'll look into the option as Nobody states: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0p =3D subprocess.Popen(...) > =C2=A0 =C2=A0 =C2=A0 =C2=A0for line in p.stdout: > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0... > =C2=A0 =C2=A0 =C2=A0 =C2=A0p.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