I want call function dynamically in Python, and code like as:
class A:
def show1(self, x) :
print x
def show2(self, x, y) :
print x, y
def callfunc(self, f, args) :
#TODO: call function f with args
pass
c = A()
c.callfunc(c.show1, [1])
c.callfunc(c.show2, [1,2])
But I do not know how to call "show1" or "show2" in callfunc. Because "show1" and "show2" has different number of args, and "args" is a list.