title: Dynamic loading of python modules
body: <p>In python how do you dynamically add modules to a package while your program is running.</p>
  
  <p>I want to be able to add modules to the package directory from an outside process, and be able to use those new modules in my program:</p>
  
  <pre><code>import package
  
  def doSomething(name):
      pkg = __import__("package." + name)
      mod = getattr(pkg, name)
      mod.doSomething()
  </code></pre>
  
  <p>How do I do this?</p>