Polling from keyboard

Jean-Paul Calderone exarkun at divmod.com
Tue May 2 16:07:50 EDT 2006


On 2 May 2006 11:04:58 -0700, "sturnfie at gmail.com" <sturnfie at gmail.com> wrote:
>I am trying to find a way to poll the keyboard.  In my searching, I
>have found that Windows users are given the msvcrt module.  Is there an
>equivilant for Unix systems?
>
>I am writing a p2p chat application, and would like to ideally approach
>user input in a manner similar to the way I am using poll() to moniter
>the sockets for events

Twisted supports stdin just like any other transport.  I have some screenshots of simple terminal-based apps I've developed with Twisted in my blog:

  http://jcalderone.livejournal.com/10572.html
  http://jcalderone.livejournal.com/10988.html

You can find examples of using these APIs in Twisted Conch's examples:

  http://twistedmatrix.com/projects/conch/documentation/examples/

Jean-Paul



More information about the Python-list mailing list