Is there an equivilant in Python for PHPs call_user_func_array?
+5
A:
Call the function with the array preceded by *:
function(*array)
Jaime Soriano
2009-11-06 17:03:48
This is the right answer.
Christopher W. Allen-Poole
2009-11-06 17:23:32
+2
A:
if your function name is a string, you could do:
getattr(obj, 'func')(*arr) # where obj is the namespace that hold func
SilentGhost
2009-11-06 17:12:33