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

-1

python get function from string name

module = __import__('foo')
func = getattr(module, 'bar')
func()
Posted by: Guest on June-25-2020

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

Python Answers by Framework

Browse Popular Code Answers by Language