2
# Copyright (c) Twisted Matrix Laboratories.
3
# See LICENSE for details.
7
An example of reading a line at a time from standard input
8
without blocking the reactor.
11
from twisted.internet import stdio
12
from twisted.protocols import basic
14
class Echo(basic.LineReceiver):
15
from os import linesep as delimiter
17
def connectionMade(self):
18
self.transport.write('>>> ')
20
def lineReceived(self, line):
21
self.sendLine('Echo: ' + line)
22
self.transport.write('>>> ')
25
stdio.StandardIO(Echo())
26
from twisted.internet import reactor
29
if __name__ == '__main__':