Keypress Input

John McKenzie davros at bellaliant.net
Wed Jun 3 14:22:15 EDT 2015


 Hello.

 Very new to Python and looking for some basic help.

 Would like a set-up where something happens when a key is pressed. Not 
propose a question, have the user type something, then hit return, then 
something happens, but just the R key is pressed, something happens, then 
something else happens if the B key is pressed, then a third thing 
happens if the G key is pressed.

 My research only served to confuse me. Firstly, I do not understand how 
it is possible for this to be a difficult thing not built into the system 
for any scripting language made within the last few decades. More to the 
point I am unclear on specific suggestions. Most of them seem to be for 
Windows only and I want this working on a Raspberry Pi. Saw getch but I 
am still confused if it is platform specific or not, or requires a module 
to be installed or not. Just get errors if I try to install getch using 
PIP.

 Other suggestions seemed to be overkill and confused me to due to my 
beginner level knowledge and the fact these suggestions have other, more 
complicated elements to them.

 I just want a button press on a device connected to a Raspberry Pi to 
trigger an action. If anyone can give me some guidance on this I would 
appreciate it.

 Thank you.




More information about the Python-list mailing list