Answers for "python dynamically call method"

2

python calling dynamic function on object

obj = MyClass()
try:
    func = getattr(obj, "dostuff")
    func()
except AttributeError:
    print "dostuff not found"
Posted by: Guest on October-31-2020

Python Answers by Framework

Browse Popular Code Answers by Language