[Tutor] Using the console module.

Alan Gauld alan.gauld at btinternet.com
Fri Mar 11 21:41:17 CET 2011

"DistortGiygas" <distortgiygas at gmail.com> wrote

> Python users, what's the best option for someone trying to emulate 
> or
> use the curses module on the Windows platform?

Write a GUI?
Unlike Unix you know that you can run a GUI on windows
so why not just write one. Its probably easier than using

> But for the life of me, I can't figure out how to detect a 
> KeyRelease.

You need the key release rather than the keypress?
I'm not sure curses can do that. I'm no curses expert though,
but I've never seen it done. Console terminals don't always have
the same level of fine grained events that a GUI has...

For keypresses see the curses example in my tutorial
(under event handling). But you still need a Windows version.

If you really need it you could try the Cygwin version
of Python which comes with curses support... But then
your users need cygwin installed too. But that might
not be an issue... And if its for personal use, well,  every
Python Windows programmer should have cygwin
installed! ;-)

Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list