#! /usr/bin/python from twisted.spread import pb from twisted.internet import reactor class Two(pb.Referenceable): def remote_print(self, arg): print "Two.print() called with", arg def main(): two = Two() def1 = pb.getObjectAt("localhost", 8800, 30) def1.addCallback(got_obj, two) # hands our 'two' to the callback reactor.run() def got_obj(obj, two): print "got One:", obj print "giving it our two" obj.callRemote("takeTwo", two) main()