AW: How to Grab Keyboards keys?

Wolff, Bernhard b.wolff at gedia.com
Wed Dec 27 03:27:19 EST 2000


Calvin Fong wrote:

> Hi, do you know the function to grab keyboards event in python
> Thank a lot.
> 
> 
> 
	I don't have UNIX/Python at hand.
	Therefore I send you some lines for Windows.
	I hope it's helpful.
	Regards Bernhard Wolff

	import msvcrt

	while 1:
	  if msvcrt.kbhit():
	    c = msvcrt.getch()
	    if c != 'q':
	      msvcrt.putch(c)
	    else:
	      break  






More information about the Python-list mailing list