input

Bjorn Pettersen BPettersen at NAREX.com
Tue Dec 11 16:13:30 EST 2001


> From: Preben [mailto:preben_er_t0ff at hotmail.com] 
> 
> How do I make a unbufferedinput from the user?
> (So they don't have to hit enter to send)
> 
> Is it possible to make it so that you don't see what you're 
> typing.. e.g. to logins? or maybe replacing the output with * ??

If you're on Windows the msvcrt module is your friend

>>> import msvcrt
>>> while 1:
...   c = msvcrt.getch()
...   print 'you typed', c
...   if c == 'q': break
...
you typed a
you typed b
you typed c
you typed d

-- bjorn




More information about the Python-list mailing list