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


Groups > comp.lang.python > #30335

Re: Reducing cache/buffer for faster display

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.023
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'output': 0.04; 'scripts': 0.09; 'sep': 0.09; 'cached,': 0.16; 'consume': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.17; 'pace': 0.17; 'relaxed': 0.22; 'so.': 0.24; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message- id:@mail.gmail.com': 0.27; 'subject:/': 0.28; 'cpu': 0.29; 'fri,': 0.30; 'file': 0.32; 'print': 0.32; 'like:': 0.33; 'to:addr:python- list': 0.33; 'received:google.com': 0.34; 'done': 0.34; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'add': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'real': 0.61; 'show': 0.63; 'heavy': 0.83; 'min': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=3MG+qnXuohlyocai0yiw87detuHVBcdGlC3EqtKNEcE=; b=DtSVAc9A4YyM3CMcbYeN8xTz5bFrJnJ9R3GFffa2qla38ngpEcCQo67eB1EnogoKAV PNFFz5BEW1JwN9fOnu7yEiv2UKyvX+3m8H2XRG+tJcktw5KunQW3xkxqIrCkDsJU3T7V tshRwtAO7zueRBqAdbZjjkdjg+2pgPxg8FibMyZ+uILQ/XdDV56e3dx/sB2bzFXbtjZd qW4eABCA5CcwmbXTaXTL2PMQdUadhraI93RMQSe5YIvWHDQgd/Zo17Wq9tygIUXhGzaA jf2mgAOjuqr7ehjuGpMnU6omIgyIGTEXrmnvRFzL/DsZuiknkzaHi13kcgJKOVB24q+1 jq1Q==
MIME-Version 1.0
In-Reply-To <cmuej9-0ml.ln1@murmur.very.softly>
References <cmuej9-0ml.ln1@murmur.very.softly>
Date Fri, 28 Sep 2012 08:09:59 +1000
Subject Re: Reducing cache/buffer for faster display
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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.1522.1348783807.27098.python-list@python.org> (permalink)
Lines 15
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1348783807 news.xs4all.nl 6856 [2001:888:2000:d::a6]:51754
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:30335

Show key headers only | View raw


On Fri, Sep 28, 2012 at 7:57 AM, Rikishi42 <skunkworks@rikishi42.net> wrote:
> I have these 2 scripts that are very heavy on the file i/o, consume a very
> reasonable amount of cpu and output their counters at a - very - relaxed
> pace to the console. The output is very simply done using something like:
>
>    print "files:", nFiles, "\r",
>
>
> Yet alltough there is no real reason for it, even a pace of a print every
> 10-30 secs will be cached, only to actually show an output update every 1-2
> min or so.

Yup! Just add a call to sys.stdout.flush() after each print.

ChrisA

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


Thread

Reducing cache/buffer for faster display Rikishi42 <skunkworks@rikishi42.net> - 2012-09-27 23:57 +0200
  Re: Reducing cache/buffer for faster display Chris Angelico <rosuav@gmail.com> - 2012-09-28 08:09 +1000
    Re: Reducing cache/buffer for faster display John Gordon <gordon@panix.com> - 2012-09-27 22:25 +0000
      Re: Reducing cache/buffer for faster display Chris Angelico <rosuav@gmail.com> - 2012-09-28 08:38 +1000
        Re: Reducing cache/buffer for faster display Rikishi42 <skunkworks@rikishi42.net> - 2012-09-28 02:05 +0200
          Re: Reducing cache/buffer for faster display Chris Angelico <rosuav@gmail.com> - 2012-09-28 18:08 +1000
            Re: Reducing cache/buffer for faster display Rikishi42 <skunkworks@rikishi42.net> - 2012-09-29 02:31 +0200
      Re: Reducing cache/buffer for faster display Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-27 21:46 -0400
        Re: Reducing cache/buffer for faster display Rikishi42 <skunkworks@rikishi42.net> - 2012-09-29 02:20 +0200
          Re: Reducing cache/buffer for faster display Hans Mulder <hansmu@xs4all.nl> - 2012-09-29 14:32 +0200
          Re: Reducing cache/buffer for faster display Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-29 14:12 -0400
    Re: Reducing cache/buffer for faster display Rikishi42 <skunkworks@rikishi42.net> - 2012-09-28 02:15 +0200

csiph-web