title: How to access same-named functions from multiple modules dynamically?
body: <p>I have a project structured this way:</p>
  
  <pre><code>├── main.py
  └── scripts
      ├── __init__.py
      ├── script1.py
      ├── script2.py
      ├── script3.py
      ├──     .
      ├──     .
      ├──     .
      └── script30.py
  </code></pre>
  
  <p>Each <code>script{i}.py</code> consists of exactly one function <code>foo</code>. What I would like to achieve is a dict of those foos along with corresponding module names in <code>main.py</code>:</p>
  
  <pre><code>result = {'script1': scripts.script1.foo, ..., 'scripts30': scripts.script30.foo}
  </code></pre>
  
  <p>What I would also love to achieve is</p>
  
  <ol>
  <li>doing it without importing <code>script{i}</code> for each <code>i</code></li>
  <li>a nice and clean code</li>
  <li>not writing names of those modules explicitly, especially inside <code>main.py</code> (number of modules in <code>scripts</code> can grow in future, it would be annoying to have to update <code>main.py</code> every time it happens).</li>
  </ol>
  
  <p>Is this even possible? All my approaches resulted in pure ugliness.
  Suggestions of restructuring my project are also welcome.</p>