[Twisted-Python] using stdin with twisted
Norman Harman
lists at knoggin.com
Thu Aug 17 18:24:56 MDT 2006
Jean-Paul Calderone wrote:
> On Thu, 17 Aug 2006 03:47:56 -0700, Norman Harman <lists at knoggin.com>
> wrote:
>> I have a program that gets apache log on stdin. I would like to add a
>> web interface and some RPC stuff to it.
>>
>> I imagine something like protocols.basic.LineReceiver is what I want.
>> But I can't figure out what ClientFactory to use or ???
>>
>> I can find very little info on doing this. The stdio package is
>> depreciated and the stdin.py example does not run.
>
> The twisted.internet.stdio package isn't deprecated (or depreciated, which
> means something else). You should use it if you want to talk to stdin in
> a Twisted program.
http://twistedmatrix.com/documents/current/api/twisted.internet.stdio.html
API Stability: unstable (pending deprecation in favor of a reactor-based
API)
I see that I jumped the gun a bit. It was late and when I saw
unstable...deprecation I went looking at reactor stuff and got lost in a
maelstrom of confusion.
> The stdin.py example runs fine for me. In what way is it broken for you?
I got a traceback (but that must have been my error). Downloading a
fresh copy it runs but never echo's instead what I type shows up at
console prompt after I ctrl-C python. It's probably win2000 cmd.exe's
fault.
The production system is Linux so use twisted.stdio on that.
thanks,
norm
More information about the Twisted-Python
mailing list