python execute string

63

python execute function from string -

import foo
method_to_call = getattr(foo, 'bar')
result = method_to_call()

Comments

Submit
0 Comments