title: Python 3 automatic conditional import?
body: <p>Is there any nice way to import different modules based on some variable value?
  My example:</p>
  
  <p>I have a folder with different modules:</p>
  
  <ul>
  <li>module_a.py</li>
  <li>module_b.py</li>
  </ul>
  
  <p>And in some other python file i want to import either module_a or module_b based on some config value:</p>
  
  <pre><code>if configVal == 'a':
      import module_a
  elif configVal == 'b':
      import module_b
  </code></pre>
  
  <p>Is there some way to avoid using if-elifs? So somehow automatically?</p>
  
  <p>like:</p>
  
  <pre><code>@conditionalImport(configVal)
  import module_
  </code></pre>
  
  <p>Or something clever?</p>