[Tutor] Interactive control with keys

Alan Gauld alan.gauld at blueyonder.co.uk
Wed Nov 5 15:29:50 EST 2003

> I continue my mp3 player learning project. I'm at a stage where I
> like to add interactive controll like "stop", "next" and "previous"
> assigned to keys "S", "N" and "P" I have no clue on how to implement
> except that I think it have to be placed or called from somewere
within the
> play function. It would be great if someone could give me a hint on
how to
> start. Not the solution but some hints to get me digging.

Check out the event driven programming page on my web tutor which
shows a simple example of reading key presses both in command
terminal mode and using Tkinter.

The terminal code is in QBASIC but similar code can be written
in Python using the getch() function found within the curses(*nix)
or mvcrt(windoze) modules.

Alan G
Author of the Learn to Program web tutor

More information about the Tutor mailing list