Let say I have a function
def my_func(a,b,c):
return a+b+c
I can only call it via a string:
eval("my_func")
Assuming I have a dictionary of corresponding parameters:
parm = {'a':1,'b':2,'c':3}
How do I pass it in to eval("my_func")
? I know that you can do it like:
eval("my_func")(parm['a'],parm['b'],parm['c'])
But if this is not a general solution since when the function changes (ie a function that has 2 parmeters as oppose to 3) it wont work.
Any ideas?