Alan Gauld wrote: > "Ricardo Aráoz" <[EMAIL PROTECTED]> wrote > >> if msvcrt.kbhit() : >> key = msvcrt.getch() >> if key == 'h' : >> print 'Hello' >> >> This is XP with 2.5 in Idle. Any ideas? > > IDLE is a GUI app running under Tkinters event loop. > I doubt if msvcrt works under Tkinter. > Try running your code in a DOS box. > > Any solution that detects keyboard input will be > very sensitive to the operational environment. > Running in a GUI (any GUI) will cause keyboard > events that are handled by the GUI toolkit. > msvcrt is designed to catch keyboasrd events > within a DOS environment. > > See the event handling page of my tutor for how > to detect keypresses within Tkinter. > > HTH, >
Thanks Alan. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor