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: 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: References: Date: Fri, 28 Sep 2012 08:09:59 +1000 Subject: Re: Reducing cache/buffer for faster display From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Fri, Sep 28, 2012 at 7:57 AM, Rikishi42 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