I have three functions:
def function_1(arg_1, arg_1, arg_1, arg_1):
return sol_1
def function_2(arg_1, arg_2, arg_3, arg_4):
return sol_2
def function_3(arg_1, arg_2, arg_3, arg_4):
return sol_3
And I would like to call them with a string:
myString = 'function_2'
eval(myString)
But I couldn't pass the arguments to the eval function to be passed to the custom defined function_2
, as they are not homogeneous (np.array
, float
, float
, int
).
Thak you Tim,
Everything had to be in string format, that worked.
eval(myString + '(arg_1, arg_2, arg_3, arg_4)')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With