I know this is valid:
def printValue():
print 'This is the printValue() method'
def callPrintValue(methodName):
methodName()
print 'This is the callPrintValue() method'
but is there a way to pass a method that receives parameters as a parameter of another function?
Doing this is not possible:
def printValue(value):
print 'This is the printValue() method. The value is %s'%(value)
def callPrintValue(methodName):
methodName()
print 'This is the callPrintValue() method'
This is the stack trace i get:
This is the printValue() method. The value is dsdsd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in callPrintValue
TypeError: 'NoneType' object is not callable