[Twisted-Python] Re: example stdin handling client that supports readline?

Michael Hudson mwh at python.net
Mon May 24 06:51:44 EDT 2004

Andrew Bennetts <andrew-twisted at puzzling.org> writes:

> On Sun, May 23, 2004 at 08:24:37PM +0200, Ellers wrote:
> [...]
>> I notice that there is a class
>> 	twisted.internet.stdio.StandardIO
>> that provides a file descriptor wrapper around stdin etc.
>> This looks good, but I'm not sure how to connect this with the cool 
>> readline functionality, which seems to block and take care of all handling 
>> of stdin?
> I'm not aware of anyone using readline with Twisted.  A couple of options
> spring to mind:
>     - use curses (see doc/examples/cursesclient.py for an example of using
>       curses in Twisted) to make your own readline-like functionality
>     - run readline in a thread, and get it to call
>       reactor.callFromThread(something.gotStdinLine, ...) everytime a user
>       hits enter.
>     - just write a GUI interface, and forget readline ;)

4) check out pyrepl from CVS and help me debug the currently rather
   hackish twisted support :-)



  I'm not particularly fond of singing GSTQ because she stands for
  some things I don't, but it's not really worth letting politics
  getting in the way of a good bawling.     -- Dan Sheppard, ucam.chat

More information about the Twisted-Python mailing list