for faq?: multithreaded curses getch()

Cliff Crawford cjc26 at nospam.cornell.edu
Sun Oct 3 18:41:20 EDT 1999


Pada Sun, 03 Oct 1999 15:55:41 +0800, Todd Owen bilang:
| To get the getch thread to block without holding the GIL, the solution I
| found was to do a select on stdin, as described in...
| a faq-oriented summary :)...!
| Hint for using curses module with threads: to wait for a keypress
| without blocking other threads, try inserting a
| "select.select([sys.stdin], [], [])" call before the call to getch().

stdwin.nodelay(1) also works--it causes getch() to always be non-blocking.


-- 
cliff crawford   http://www.people.cornell.edu/pages/cjc26/
            There are more stars in the sky than there are
-><-        grains of sand on all the beaches of the world.




More information about the Python-list mailing list