Answers for "how to execute a function from the string name in python"

1

python execute function from string

import foo
method_to_call = getattr(foo, 'bar')
result = method_to_call()
Posted by: Guest on April-07-2020

Code answers related to "how to execute a function from the string name in python"

Python Answers by Framework

Browse Popular Code Answers by Language