[Twisted-Python] Controlling twisted via stdin

How do I use the reactor.addReader/Writer methods? I would like to control a twisted server using stdin. Does data on stdin get passed to a protocol's dataReceived? Thanks. Brian

On Mon, Mar 24, 2008 at 11:27 PM, Brian Baquiran <brianbaquiran@gmail.com> wrote:
The simplest way to get a protocol running on stdio has nothing to do with addReader and addWriter, and you likely want to stay away from them. Try using twisted.internet.stdio.StandardIO(protocolInstance). (that's a protocol *instance*, not a factory or class) There's an example in doc/core/examples/stdin.py, and a more complex demo at doc/core/examples/stdiodemo.py. -- Christopher Armstrong International Man of Twistery http://radix.twistedmatrix.com/ http://twistedmatrix.com/ http://canonical.com/

On Mon, Mar 24, 2008 at 11:27 PM, Brian Baquiran <brianbaquiran@gmail.com> wrote:
The simplest way to get a protocol running on stdio has nothing to do with addReader and addWriter, and you likely want to stay away from them. Try using twisted.internet.stdio.StandardIO(protocolInstance). (that's a protocol *instance*, not a factory or class) There's an example in doc/core/examples/stdin.py, and a more complex demo at doc/core/examples/stdiodemo.py. -- Christopher Armstrong International Man of Twistery http://radix.twistedmatrix.com/ http://twistedmatrix.com/ http://canonical.com/
participants (2)
-
Brian Baquiran
-
Christopher Armstrong