keyboard input

Peter Hansen peter at engcorp.com
Thu Sep 28 05:45:29 CEST 2000


Fredrik Lundh wrote:
> 
> Georg Simon wrote:
> > How do I make my program ask for one single keystroke ?
> > ( The user is presented a menu and asked to hit a key )
> 
> char = msvc.getch() # windows only

Typo in above, I think.  Use:

import msvcrt
char = msvcrt.getch()

See
http://www.pythonlabs.com/pub/www.python.org/doc/2.0b1/lib/msvcrt-console.html.



More information about the Python-list mailing list