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


Groups > comp.lang.python > #11698

Re: Wait for a keypress before continuing?

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Wait for a keypress before continuing?
Date 2011-08-17 13:02 -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>
Newsgroups comp.lang.python
Message-ID <mailman.136.1313600587.27778.python-list@python.org> (permalink)

Show all headers | 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