best practices: dynamic method execution in python
<p>I'm just starting out in python after years of Java, C, c++, etc.
I have a long list of files/modules that each contain one major method that I want to call dynamically. For each keyword, I have a .py file with the name get_foo and inside each get_foo.py, there is a foo method.  So I want to pass in the command name "foo" and execute the method get_foo.foo()</p>

<p>I really don't want to do this with an ugly if/then/else block</p>

<pre><code>sections = [ "abstract",  "claim",  "drawing", "examiner"]
command = "claim"
</code></pre>

<p>What I want to something like</p>

<pre><code>exec("get_" + command + "." + command)
</code></pre>

<p>But I really don't know even which areas of exec/eval/etc do this.</p>
