[Twisted-Python] Manhole and StandardIO

Jean-Paul Calderone exarkun at divmod.com
Mon Jan 12 17:21:31 EST 2009


On Mon, 12 Jan 2009 23:09:40 +0100, Zoran Bosnjak <zoran.bosnjak at sloveniacontrol.si> wrote:
>Hello all,
>I would like to have a simple console python interactive shell,
>powered by twisted.
>
>I am looking for something like this...
>---
>from twisted.internet import reactor, stdio
>from twisted.conch.manhole import Manhole
>
>stdio.StandardIO(Manhole())
>reactor.run()
>---
>... but it does not work.
>

StandardIO accepts an IProtocol provider as an argument.  Manhole does not
implement IProtocol, it implements ITerminalProtocol.  So you cannot use
these two classes together like this.

See twisted/conch/stdio.py for examples of how to use manhole on stdio.

Jean-Paul




More information about the Twisted-Python mailing list