Inactive Tutor answered 11/12/19
Tutor
New to Wyzant
Use .__dict__!
result = foo.__dict__['bar'](input)
print(result)
.__dict__ returns a dictionary mapping the names for a module's attributes to their corresponding functions/values. Foo.__dict__ might return something like:
>>> foo.__dict__
{'bar':<attr 1>,
'baz':<attr 2>,
'blerg':<function 1>,
'asdf':<function 2>}
By iterating over the keys in this dictionary, you can select which functions you want to call pretty arbitrarily!