title: How to dynamically import modules with exec
body: <p>Now I want to built a function get_doc( ) which can get the <strong>doc</strong> of the module
  Here's the code</p>
  
  <pre><code>def get_doc(module):
      exec "import module"
      print module.__doc__
  </code></pre>
  
  <p>And the information returned:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;pyshell#36&gt;", line 1, in &lt;module&gt;
      get_doc(sys)
  NameError: name 'sys' is not defined
  </code></pre>