[Twisted-Python] Re: readline-like behavior inside Twisted (was Re:Re: Synchronization techniques)

Michael Hudson micahel at gmail.com
Mon Apr 9 13:47:16 EDT 2007

Jean-Paul Calderone <exarkun <at> divmod.com> writes:

> On Mon, 9 Apr 2007 14:33:26 +0000 (UTC), Michael Hudson <micahel <at>
gmail.com> wrote:
> >Jean-Paul Calderone <exarkun <at> divmod.com> writes:
> >
> >> I haven't looked at pyreadline before, although I did take a look at UNC a
> >> long time ago.  Taking a quick look at the code, it looks like converting
> >> pyreadline to be Twisted friendly may be doable.
> >
> >This isn't really a followup, but it seems worthwhile to mention that GNU
> >readline itself has a callback interface (rl_callback_read_char) that would be
> >suitable for using with Twisted.  You'd have to use ctypes or something to get
> >to it, but it's there.
> Good point, I'd forgotten about that API.

Make sure you use readline 5.1 (or newer) though, otherwise your app will hang
when the user presses C-r :-)


More information about the Twisted-Python mailing list