How is calling module and function by string handled in python?
<p><a href="http://stackoverflow.com/q/3061">Calling a function from a string with the function&#39;s name in Python</a> shows us how to call a function by using getattr("<strong>bar</strong>")(), but this assumes that we have the module <strong>foo</strong> imported already.</p>

<p>How would would we then go about calling for the execution of <strong>"foo.bar"</strong> assuming that we probably also have to perform the import of <strong>foo</strong> (or from <strong>bar</strong> import <strong>foo</strong>)?</p>
