Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'output': 0.04; 'puts': 0.07; 'trailing': 0.07; 'python': 0.09; 'cursor': 0.09; 'mess': 0.09; 'messing': 0.09; 'overwrite': 0.09; 'sep': 0.09; 'carriage': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'incomplete': 0.16; 'ugly.': 0.16; 'wrote:': 0.17; 'fine,': 0.22; 'errors': 0.23; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'subject:/': 0.28; '(unless': 0.29; 'case,': 0.29; 'fri,': 0.30; '(and': 0.32; 'to:addr:python- list': 0.33; 'received:google.com': 0.34; 'done': 0.34; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'display': 0.36; 'does': 0.37; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'john': 0.60; 'back': 0.62; 'delay.': 0.84; 'ripe': 0.91 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=i5uz4Sw5ZiwvbNtWGXC+6xmdffxw55so6VbWEKSwQMI=; b=cxyS4aCK4v83fW6AwU9U5Xgw+1jYucKWs7jy/2NFk5MSoJObzfNt+b4r6gfoqt3ijN v9sAWleYAPy8Jwe7hl9e7yPVnUUW/nrb20g9TCc15DuUEMuCrByPB3hsUZ13D6sZhx2G 8aIrDIJdvYhdRNcLD3IZ7YRrS7hDnzSir3YYSswESXU+wMUcWQP0eH9doOQnMB2GJvw8 uK7OGdefBV3y+K5PD9VZ4KZP9j68pRD9XyBYZ6fcimDGOGM2sfbsPyusXYn8QUbeFLgv Wkjr1kbgs57MyjPLJbwEHGbDHVXLGsQUArgtwhQJjUe+rbx6XKwL/DJbImElenoLBJg8 Of3g== MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 28 Sep 2012 08:38:29 +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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348785513 news.xs4all.nl 6928 [2001:888:2000:d::a6]:35918 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30337 On Fri, Sep 28, 2012 at 8:25 AM, John Gordon wrote: > Isn't terminal output line-buffered? I don't understand why there would > be an output delay. (Unless the "\r" is messing things up...) This is a classic progress-indication case, which does indeed mess up line-buffering. The carriage return (and no line feed, done in the Python 2 style of a trailing comma) puts the cursor back to the beginning of the line, ready to overwrite, and ripe for one of those old favorite incomplete overwrite errors - if nFiles monotonically increases, it's fine, but if it decreases, the display can get ugly. ChrisA