Can a Python function be an argument of another function?
Say:
def myfunc(anotherfunc, extraArgs):
# run anotherfunc and also pass the values from extraArgs to it
pass
So this is basically two questions:
- Is it allowed at all?
- And if it is, how do I use the function inside the other function? Would I need to use exec(), eval() or something like that? Never needed to mess with them.
BTW, extraArgs is a list/tuple of anotherfunc's arguments.