how to call back a method ?

elearn elearn2014 at gmail.com
Sun Aug 3 22:33:04 EDT 2014


I want to call back a function which is the method of a class .

     def callback(self.do,x):
         return(self.do(x))

That is what i want to write,when i input

     def callback(self.do,x):

error message:


       File "<stdin>", line 1
         def callback(self.do,x):
                      ^
     SyntaxError: invalid syntax


`do` is a method in my class ,how to write the code?



More information about the Python-list mailing list