Calling a function of a module by using its name (a string)

How do I call a function, using a string with the function's name? For example:

import foo
func_name = "bar"
call(foo, func_name)  # calls foo.bar()

← Назад к списку