For example, if I have a function called add like
add
def add(x,y): return x+y
and I want the ability to convert a string or a
unutbu's solution is what I would normally use, but for completeness sake:
If you are specifying the exact name of the function, you can use eval, although it is highly discouraged because people can do malicious things:
eval
eval("add")(x,y)