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


Groups > comp.lang.python > #92325

Re: Query regarding sys.stdout.write

X-FeedAbuse http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63
Path csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!news.muarf.org!news.roellig-ltd.de!open-news-network.org!border2.nntp.ams1.giganews.com!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'none,': 0.05; 'subject:skip:s 10': 0.05; 'seemed': 0.07; 'yeah,': 0.09; 'cc:addr :python-list': 0.10; 'python': 0.11; 'breeding': 0.16; 'curses': 0.16; 'directive': 0.16; 'fatal': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ibm.': 0.16; 'python;': 0.16; 'sense,': 0.16; 'sequence,': 0.16; 'simpson': 0.16; 'stdlib.': 0.16; 'subject:Query': 0.16; 'wrote:': 0.16; 'say,': 0.18; 'string,': 0.18; 'url:au': 0.18; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'saying': 0.22; 'am,': 0.23; '2015': 0.23; 'module': 0.23; 'errors': 0.23; 'seems': 0.24; 'header:In- Reply-To:1': 0.24; 'words': 0.24; 'mon,': 0.24; 'ibm': 0.27; 'message-id:@mail.gmail.com': 0.28; 'ansi': 0.29; 'piece': 0.29; 'point.': 0.29; 'consult': 0.33; 'subject:regarding': 0.33; 'true.': 0.33; 'received:google.com': 0.34; 'robert': 0.35; "isn't": 0.35; 'but': 0.36; 'thanks': 0.36; 'should': 0.37; "didn't": 0.37; 'subject:: ': 0.37; 'version': 0.38; 'is,': 0.38; 'end': 0.39; 'whatever': 0.39; 'does': 0.39; 'term': 0.60; 'your': 0.60; 'times': 0.61; 'making': 0.64; 'cameron': 0.66; 'course.': 0.67; 'url:2011': 0.75; 'chrisa': 0.84; 'heh.': 0.84; 'nouns,': 0.84; 'technique.': 0.84; 'to:none': 0.90
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:cc :content-type; bh=mg7b20OLAL2HhjGFZfsVg9B18Sos8hYvo9vp/xtRhP8=; b=eFF+49A6fFM1oCS/L/FioATMXfQ4DEQ1OqVI4QgnJJDmgVBTHt67CNSx4cWeDxViOK 9+nDiyNt1HGIhoNR80bvOZ1IwkVaDfSznt8nsZV1h5WwmW1MsVNuo5Pd9s62EinVL/NM Rczb3spWP6kiZaCJQJZvqAd00g9S5G94baWVcTv1btYGZ4T8ySD8SVzekdGi3YAty475 z6Nybi3FrSfAEHIiY+mSmABOvKINJdCvAmdM/VmkDdIsMQIgPfi8e5M3hj/8vYN+qwhl 3H4ToMtP0UPMpojeyjF2n7h7rwmQNBKh0iG+9OqMqQYKnr3tapmbthqGPg+/JY90Te0Z VBdw==
MIME-Version 1.0
X-Received by 10.50.61.241 with SMTP id t17mr10890960igr.34.1433733569433; Sun, 07 Jun 2015 20:19:29 -0700 (PDT)
In-Reply-To <20150608015625.GA74401@cskk.homeip.net>
References <CAPTjJmqnaO-MM230s1HwaHXWEyPdEi3Te1RQkfsi6D70T9ttHA@mail.gmail.com> <20150608015625.GA74401@cskk.homeip.net>
Date Mon, 8 Jun 2015 13:19:29 +1000
Subject Re: Query regarding sys.stdout.write
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.289.1433733572.13271.python-list@python.org> (permalink)
Lines 32
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1433733572 news.xs4all.nl 2908 [2001:888:2000:d::a6]:37158
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:92325

Show key headers only | View raw


On Mon, Jun 8, 2015 at 11:56 AM, Cameron Simpson <cs@zip.com.au> wrote:
> If you want do do this version portably, hook into the Python curses module
> and get the result of curses.tigetstr('el'). If that returns None, the
> terminal does not support clear-to-end-of-line and you should use the
> spaces-overwrite technique. But if it returns a string, you can write that
> string, whatever it is, to erase to the end of the line.
>
> Most modern terminals are ANSI supersets, but the terminfo database has a
> huge suite of descriptions of terminals, and this will get your the right
> sequence, whatever that may be, for your current terminal.

Fair point. I hard-coded it in LetMeKnow because I didn't know of a
way to access terminfo in Python; thanks for the tip. Although...

> Of course, reaching for the curses module is massive overkill in a sense,
> but it is the only way to consult terminfo in the Python stdlib.

... yeah, massive overkill.

> But I have to say, I "non-concur." (Non-concur was a term I learned at
> IBM. IBM seemed to be a breeding ground for making up words and
> phrases, turning verbs into nouns, etc. "Non-concur" seems to be for
> those times when saying "I disagree" just isn't strong enough!)
>        - Robert D. Seidman <robert@clark.net>

Heh. That is so true. My favourite piece of IBM-speak comes from the
OS/2 config.sys directive "REIPL=C", which causes fatal errors to be
logged to C:\POPUPLOG.OS2 ... of course.

http://rosuav.blogspot.com.au/2011/01/reiplophobia.html

ChrisA

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


Thread

Re: Query regarding sys.stdout.write Chris Angelico <rosuav@gmail.com> - 2015-06-08 13:19 +1000

csiph-web