NewBie: How Can I Scan The Keyboard In Python?

jbranthoover at my-deja.com jbranthoover at my-deja.com
Fri Jan 12 08:47:30 EST 2001


Hello Fredrik,
	Thank you for your response.  I guess that neglected to mention
that I am running Python 1.5.2 on a Lynx (not linux) box.  I suppose
that the msvcrt module makes use of windows API calls and must run on a
windows based system?

	Anyway thanks for the information.  If you have any other
Ideas,  please pass them along.  Have a great day...!



In article <epn76.5525$Qb7.771036 at newsb.telia.net>,
  "Fredrik Lundh" <fredrik at effbot.org> wrote:
> jbranthoover at my-deja.com wrote:
> > Is there a way to scan the keyboard to watch for a key
> > closure?
>
>     http://www.python.org/doc/FAQ.html#8.2
>     "8.2. How to check for a keypress without blocking?
>     "Use the msvcrt module. This is a standard Windows-specific
>     extensions in Python 1.5 and beyond. It defines a function
>     kbhit() which checks whether a keyboard hit is present; also
>     getch() which gets one character without echo. Plus a few
>     other goodies."
>
> for more info, see the library reference.
>
> Cheers /F
>
>


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list