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


Groups > comp.lang.python > #11698

Re: Wait for a keypress before continuing?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'escape': 0.04; 'python)': 0.05; 'received:verizon.net': 0.07; 'terry': 0.07; 'nicely': 0.09; 'okay': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'tty': 0.09; 'api': 0.09; 'library': 0.15; '(another': 0.16; 'cursor': 0.16; 'guis': 0.16; 'guis,': 0.16; 'msvcrt': 0.16; 'reedy': 0.16; 'scales': 0.16; 'subject:continuing': 0.16; 'versus': 0.16; 'this:': 0.16; 'wrote:': 0.16; 'linux': 0.17; 'part,': 0.18; 'jan': 0.19; '(which': 0.19; 'seems': 0.20; "haven't": 0.20; 'stuff': 0.22; 'header:In-Reply-To:1': 0.22; 'end,': 0.23; 'exist,': 0.23; 'missed': 0.24; 'pm,': 0.24; 'command': 0.24; 'input': 0.24; 'code': 0.25; 'creating': 0.25; 'remote': 0.28; 'module': 0.30; 'also.': 0.30; 'equivalent': 0.31; 'subject:?': 0.31; 'usually': 0.32; 'it.': 0.33; 'there': 0.33; 'to:addr :python-list': 0.33; 'difference': 0.34; 'done': 0.34; 'header :User-Agent:1': 0.34; 'setting': 0.34; 'surprised': 0.34; 'header:X-Complaints-To:1': 0.35; 'rather': 0.35; 'doing': 0.36; 'keyboard': 0.37; 'using': 0.37; 'but': 0.37; 'two': 0.37; 'received:org': 0.38; 'some': 0.38; 'should': 0.38; 'subject:: ': 0.39; 'header:Mime-Version:1': 0.39; 'user': 0.39; "there's": 0.39; 'to:addr:python.org': 0.39; 'case': 0.39; 'sense': 0.39; 'hit': 0.40; 'where': 0.40; 'one,': 0.40; 'your': 0.61; 'devices': 0.63; 'designed': 0.65; 'direct': 0.66; 'specialized': 0.72; 'click': 0.79; 'console,': 0.84; 'evolved': 0.84; 'joke': 0.84; 'physically': 0.84; 'contrast': 0.91; 'utilities,': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Wait for a keypress before continuing?
Date Wed, 17 Aug 2011 13:02:35 -0400
References <4e3f2827$0$5826$c3e8da3$12bcf670@news.astraweb.com> <2670f4ee-0ab4-42ba-a472-42a4c7669ce8@p5g2000vbl.googlegroups.com> <slrnj4nrpf.clc.usenet-nospam@guild.seebs.net>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-74-109-121-73.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0
In-Reply-To <slrnj4nrpf.clc.usenet-nospam@guild.seebs.net>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
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.136.1313600587.27778.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1313600587 news.xs4all.nl 23983 [2001:888:2000:d::a6]:46183
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:11698

Show key headers only | View raw


On 8/17/2011 12:33 PM, Seebs wrote:
> On 2011-08-17, peter<peter.mosley@talk21.com>  wrote:
>> Is there an equivalent to msvcrt for Linux users?  I haven't found
>> one, and have resorted to some very clumsy code which turns off
>> keyboard excho then reads stdin. Seems such an obvious thing to want
>> to do I am surprised there is not a standard library module for it. Or
>> have I missed someting (wouldn't be the first time!)
>
> There's no direct equivalent to the whole of msvcrt.  The Unixy way to
> do stuff like that on the command line is usually curses.  But to make
> a long story short:  Unix evolved in a setting where there was often
> not a user at *THE* console, and users were often on devices such that
> it made sense to have all the line editing happen on the remote end, with
> the remote end sending a completed line once the user was done with all
> that stuff like backspaces.
>
> Unix programs that do stuff like this for tty input do exist, of course,
> but for the most part, they use an entire API designed for creating such
> utilities, rather than one or two specialized functions.  (Another part
> of the reason for this:  The Unix solution scales nicely to the case where
> the five people using your program will be doing so on physically
> different hardware terminals which don't use the same escape sequences
> for cursor movement.)

The difference is between "Hit <enter> to continue" (which we can do in 
portable Python) versus "Hit any key to continue" (which we cannot, and 
which also leads to the joke about people searching for the 'any' key 
;-). The equivalent contrast for GUIs is "Click OK to continue" versus 
"Click anywhere to continue" If having to click a specific area is okay 
for GUIs, having to hit a specific key for TUIs should be also.


-- 
Terry Jan Reedy

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


Thread

Wait for a keypress before continuing? John Doe <jdoe@usenetlove.invalid> - 2011-08-08 00:04 +0000
  Re: Wait for a keypress before continuing? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-08-08 10:27 +1000
    Re: Wait for a keypress before continuing? John Doe <jdoe@usenetlove.invalid> - 2011-08-08 02:44 +0000
      Re: Wait for a keypress before continuing? Gelonida N <gelonida@gmail.com> - 2011-08-08 09:41 +0200
  Re: Wait for a keypress before continuing? John Doe <jdoe@usenetlove.invalid> - 2011-08-16 18:42 +0000
    Re: Wait for a keypress before continuing? John Doe <jdoe@usenetlove.invalid> - 2011-08-16 18:48 +0000
  Re: Wait for a keypress before continuing? John Doe <jdoe@usenetlove.invalid> - 2011-08-16 20:16 +0000
    Re: Wait for a keypress before continuing? Tim Roberts <timr@probo.com> - 2011-08-16 14:50 -0700
      Re: Wait for a keypress before continuing? John Doe <jdoe@usenetlove.invalid> - 2011-08-16 21:59 +0000
        Re: Wait for a keypress before continuing? Jerry Hill <malaclypse2@gmail.com> - 2011-08-16 20:11 -0400
          Re: Wait for a keypress before continuing? John Doe <jdoe@usenetlove.invalid> - 2011-08-17 03:52 +0000
            Re: Wait for a keypress before continuing? Seebs <usenet-nospam@seebs.net> - 2011-08-17 05:06 +0000
              Re: Wait for a keypress before continuing? John Doe <jdoe@usenetlove.invalid> - 2011-08-17 05:49 +0000
                Re: Wait for a keypress before continuing? Seebs <usenet-nospam@seebs.net> - 2011-08-17 06:12 +0000
                Re: Wait for a keypress before continuing? Chris Angelico <rosuav@gmail.com> - 2011-08-17 08:19 +0100
                Re: Wait for a keypress before continuing? John Doe <jdoe@usenetlove.invalid> - 2011-08-17 07:23 +0000
                Re: Wait for a keypress before continuing? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-08-17 18:28 +1000
                Re: Wait for a keypress before continuing? Seebs <usenet-nospam@seebs.net> - 2011-08-17 16:33 +0000
                Re: Wait for a keypress before continuing? Ethan Furman <ethan@stoneleaf.us> - 2011-08-17 10:37 -0700
                Re: Wait for a keypress before continuing? Ethan Furman <ethan@stoneleaf.us> - 2011-08-17 06:21 -0700
        Re: Wait for a keypress before continuing? Tim Roberts <timr@probo.com> - 2011-08-21 19:02 -0700
  Re: Wait for a keypress before continuing? John Doe <jdoe@usenetlove.invalid> - 2011-08-16 23:46 +0000
  Re: Wait for a keypress before continuing? peter <peter.mosley@talk21.com> - 2011-08-17 01:03 -0700
    Re: Wait for a keypress before continuing? Hans Mulder <hansmu@xs4all.nl> - 2011-08-17 16:16 +0200
      Re: Wait for a keypress before continuing? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-08-18 02:36 +1000
      Re: Wait for a keypress before continuing? peter <peter.mosley@talk21.com> - 2011-08-18 01:24 -0700
        Re: Wait for a keypress before continuing? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-08-18 09:50 -0700
        Re: Wait for a keypress before continuing? Nobody <nobody@nowhere.com> - 2011-08-18 18:58 +0100
    Re: Wait for a keypress before continuing? Seebs <usenet-nospam@seebs.net> - 2011-08-17 16:33 +0000
      Re: Wait for a keypress before continuing? Terry Reedy <tjreedy@udel.edu> - 2011-08-17 13:02 -0400
        Re: Wait for a keypress before continuing? Seebs <usenet-nospam@seebs.net> - 2011-08-17 17:05 +0000
        Re: Wait for a keypress before continuing? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-08-18 04:29 +1000
          Re: Wait for a keypress before continuing? Chris Angelico <rosuav@gmail.com> - 2011-08-17 23:10 +0100

csiph-web