Keypress Input

John McKenzie davros at bellaliant.net
Sat Jun 6 14:28:29 EDT 2015


 Laura and Gary, thank you for your replies. I have three physical 
buttons connected to a Kade device emulating a keyboard. These buttons 
control an LED light strip. So there is no screen, so a GUI did not cross 
my mind. I thought it made sense as it is easily done by other scripting 
languages. Thank you both for pointing my in the right direction.

 It turns out Tkinter is installed on Raspian and my Pi has it. Typing 
import tkinter into the Python interpreter gave me an error, then I 
corrected my spelling. The T should be upper case. No errors with "import 
Tkinter".

 Laura, thank you for typing up example code. I had to remove one indent 
on line 9, but after that it worked on my desktop. The Pi gave an error 
about Tkinter when I tried to run your code but I will work on that. In 
the meantime I will work my basic code out on the desktop and then move 
it over to the Pi, adapting it for and fixing Pi issues then.

 In my mind the Tkinter information I read on the web contradicts the 
examples given with the text, so obviously I am not getting it at all. 
Tkinter seems very confusing to me right now, but I think I just need to 
review the conceptual stuff again and keep trying. Also, I have your 
example, which I can experiment with.
 

 Thanks.














More information about the Python-list mailing list