Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #92325
| References | <CAPTjJmqnaO-MM230s1HwaHXWEyPdEi3Te1RQkfsi6D70T9ttHA@mail.gmail.com> <20150608015625.GA74401@cskk.homeip.net> |
|---|---|
| Date | 2015-06-08 13:19 +1000 |
| Subject | Re: Query regarding sys.stdout.write |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.289.1433733572.13271.python-list@python.org> (permalink) |
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
Re: Query regarding sys.stdout.write Chris Angelico <rosuav@gmail.com> - 2015-06-08 13:19 +1000
csiph-web