def x(*args, **kwargs):
print(args)
print(kwargs)
def y(other, function, *args, **kwargs):
function(*args, **kwargs)
print(other)
y('other',x, 1, 2, client='client')
简单的例子
>>> def x(a,b):
... print "param 1 %s param 2 %s" % (a,b)
...
>>> def y(z,t):
... z(*t)
...
>>> y(x, ("hello","manuel"))
param 1 hello param 2 manuel
参考
https://stackoverflow.com/questions/6289646/python-function-as-a-function-argument