You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
596 B

#-*- coding: utf-8 -*-
from rivescript import RiveScript
from twisted.internet import protocol, reactor, endpoints
from twisted.protocols.basic import LineReceiver
class Echo(LineReceiver):
def lineReceived(self, line):
print("I just receive "+line)
class EchoFactory(protocol.Factory):
def buildProtocol(self, addr):
return Echo()
rs = RiveScript()
endpoints.serverFromString(reactor, "tcp:1234").listen(EchoFactory())