[Tutor] how does one poll the keyboard?

tonycervone tonycervone@netzero.net
Fri, 23 Nov 2001 11:37:09 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C17413.2FC49EA0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

 How does one poll the keyboard with Python to see if a specific key( =
that I choose to define as the key to press) has been pressed while a =
program is running?  I guess the script would poll the keyboard and run =
in the background of a main program.Of course, the script could not have =
an indefinite loop so as to prevent the program from running. The =
program will then quickly run the script and if the key has been pressed =
a message will appear that such a key has been pressed.=20
thanks.
PS. I have now most books on Python; yet I still feel that the indices =
are not comprehensive enough for novices.  I know that this is a general =
statement, but for this particular question , for example, I could not =
find anything in the back of the books. the books are: The quick Python =
Book, Python Standard Library, learn to Program using Python, and the =
big Core Python Programming. Considering the number of pages( a lot), =
they all seem to lack easy and comprehensive indices. The examples in =
the books, too, have very small type and assume some intuition about how =
Python works . This is not meant as a criticism, but constructive =
observations that should help authors who want to reach a wider general =
want to be audience. The folks are among the best, most knowlegeable and =
kind helpers I have found. So keep up the good work.


  tony

------=_NextPart_000_0005_01C17413.2FC49EA0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>&nbsp;How does one poll the keyboard =
with Python to=20
see if a specific key( that I choose to define as the key to press) has =
been=20
pressed while a program is running?&nbsp; I guess the script would poll =
the=20
keyboard and run in the background of a main program.Of course, the =
script could=20
not have an indefinite loop so as to prevent the program from running. =
The=20
program will then quickly run the script and if the key has been pressed =
a=20
message will appear that such a key has been pressed. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>thanks.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>PS. I have now most books on Python; =
yet I still=20
feel that the indices are not comprehensive enough for novices.&nbsp; I =
know=20
that this is a general statement, but for this particular question , for =

example, I could not find anything in the back of the books. the books =
are: The=20
quick Python Book, Python Standard Library, learn to Program using =
Python, and=20
the big Core Python Programming. Considering the number of pages( a =
lot), they=20
all seem to lack easy and comprehensive indices. The examples in the =
books, too,=20
have very small type and assume some intuition about how Python =
works&nbsp;.=20
This is not meant as a criticism, but constructive observations that =
should help=20
authors who want to reach a wider general want to be audience. The folks =
are=20
among the best, most knowlegeable and kind helpers I have found. So keep =
up the=20
good work.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;tony</FONT></DIV></BODY></HTML>

------=_NextPart_000_0005_01C17413.2FC49EA0--

----------------------------------------------------
Sign Up for NetZero Platinum Today
Only $9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97