[Twisted-Python] How to get callback return value

yangyouxiu yangyouxiu at gmail.com
Tue Dec 3 02:56:11 MST 2013


Hi,all!

On call main method, it call self.getName() in A.py, as I use callback, I can not get the return value correctly, I thought it's because the Asynchronous attribute, how should i do?

B.py
main:
name=self.getName()


A.py
def getname():
def.callback(method1)
def.callback(method2)
def.callback(success)
return self.name

def success(name):
self.name=name


Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131203/cd324e23/attachment.html>


More information about the Twisted-Python mailing list