[Twisted-web] simple example with xmlrpc server

Ivan bdfy at mail.ru
Sat Apr 16 17:24:53 EDT 2011


I have simple example with xmlrpc server from standart python:

from SimpleXMLRPCServer import SimpleXMLRPCServer
from time import sleep
import threading,time

class Test(threading.Thread):
    def __init__(self):
        threading.Thread.__init__(self)
        self.test1 = 0
    def test(self):
        return self.test1

    def run(self):
        while(1):
            time.sleep(1)
            self.test1 = self.test1 + 1

ts = Test()
ts.start()
server =  SimpleXMLRPCServer(("localhost",8888))
server.register_instance(ts)
server.serve_forever()

how it will look on Twisted ?



More information about the Twisted-web mailing list