title: Importing Modules from Python Package without specifying their names
body: <p>I am trying to import modules in Python dynamically.
  That means - I have a Python package with modules inside.
  Without specifying the modules names, I want to keep a dictionary of each module's name to the pointer to this module.</p>
  
  <p>I tried to use the suggestion from <a href="https://stackoverflow.com/questions/1707709/list-all-the-modules-that-are-part-of-a-python-package">this discussion</a></p>
  
  <p>My directory is:</p>
  
  <pre><code>foo/
      __init__.py
      bar1.py
      bar2.py
  </code></pre>
  
  <p>the script I use is:</p>
  
  <pre><code>import pkgutil
  import foo
  
  for importer, name, ispkg in pkgutil.iter_modules(foo.__path__, foo.__name__ + "."):
      print "Found submodule %s (is a package: %s)" % (name, ispkg)
      module = __import__(name)
      print "Imported", module
  </code></pre>
  
  <p>The output I get for the first iteration is:</p>
  
  <pre><code>Found submodule foo.bar1 (is a package: False)
  Imported &lt;module 'foo' from '/path/to/foo/__init__.pyc'&gt;
  </code></pre>
  
  <p>So instead of getting my bar1 module using this, I get the foo package with the import.</p>
  
  <p>How can I get the bar1 and bar2 modules?</p>
  
  <p>Other methods are welcome if the use of pkgutil is not right.</p>