Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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: UNSURE 0.253 X-Spam-Level: ** X-Spam-Evidence: '*H*': 0.58; '*S*': 0.09; 'windows': 0.15; 'ah,': 0.16; 'bryan': 0.16; "campbell's": 0.16; 'soap,': 0.16; 'subject:Lines': 0.16; 'url:shtml': 0.16; 'wrote:': 0.18; 'import': 0.22; 'skip:l 30': 0.24; 'skip:{ 20': 0.24; 'cheers,': 0.24; 'mention': 0.26; 'header:In-Reply-To:1': 0.27; 'nature': 0.30; "i'm": 0.30; 'pipe': 0.31; 'running': 0.33; 'url:non- standard http port': 0.33; 'received:66': 0.35; 'but': 0.35; 'up!': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'dangerous': 0.60; 'url:%20': 0.61; 'header:Message-Id:1': 0.63; 'charset:windows-1256': 0.64; 'more': 0.64; 'url:%1': 0.72; 'million': 0.74; 'received:204': 0.75; 'hand': 0.80; 'citizens.': 0.84; 'boxes': 0.91; 'hands': 0.96; '2013': 0.98 X-Spam-Status: No, score=-2.1 required=5.0 X-Spam-Level: From: Gene Heskett To: python-list@python.org Subject: Re: Limit Lines of Output Date: Tue, 25 Jun 2013 17:48:13 -0400 References: <0cb638ec-a4bd-4a45-b98c-a7c76996bab7@googlegroups.com> <842bc651-0bed-45df-9a29-2049279f4434@googlegroups.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1256" Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 26 Jun 2013 12:41:30 +0200 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372243291 news.xs4all.nl 15877 [2001:888:2000:d::a6]:38312 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49241 On Tuesday 25 June 2013 17:47:22 Joshua Landau did opine: > On 25 June 2013 21:22, Bryan Britten wrote: > > Ah, I always forget to mention my OS on these forums. I'm running > > Windows. > > Supposedly, Windows has "more" > [http://superuser.com/questions/426226/less-or-more-in-windows], Yes, but less is more than more. > For Linux+less; this works: > > from subprocess import Popen, PIPE > less = Popen("less", stdin=PIPE) > less.stdin.write(b"\n".join("This is line number > {}".format(i).encode("UTF-8") for i in range(1000))) > less.wait() Cheers, Gene -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) My web page: is up! My views Campbell's Law: Nature abhors a vacuous experimenter. A pen in the hand of this president is far more dangerous than 200 million guns in the hands of law-abiding citizens.