All pastes #258305 Raw Edit

jespern

public python v1 · immutable
#258305 ·published 2006-11-26 11:35 UTC
rendered paste body
from twisted.internet import protocol, utils, reactorclass tclient(protocol.Protocol):    def connectionMade(self):	print "Hum, made connection"    def childDataReceived(self, data, lampe):	print "childDataReceived (%d)" % len(lampe)	print lampe    def inConnectionLost(self):	print "inConnectionLost"    def outConnectionLost(self):	print "client closed stdout"    def processEnded(self, status):	print "process died with %d" % status.value.exitCode	reactor.stop()    def childConnectionLost(self, data):	if data == 0:	    print "child connection lost"if __name__ == "__main__":    pp = tclient()    reactor.spawnProcess(pp, "/Users/jespern/Work/lib/bin/dummy.py", [], {})    reactor.run()