title: Importing modules globally
body: <p>I would like to provide users with a python script which would import some modules for them and then drop to the python interpreter with the imported modules available at that level. I have some code which I thought might work, but it does not seem to:</p>
  
  <pre><code>module_list = ['module_a','module_b']
  
  # Import our common modules
  for module in module_list:
  try:
      print "Importing: {0}".format(module)
      exec("import {0}".format(module))
  except:
      print "FYI we failed importing {0}. It will not be available for you to use".format(module)              
  </code></pre>
  
  <p>So when the script is done it will drop to the python module where the user can do:</p>
  
  <pre><code>&gt;&gt;&gt; module_a.run()
  </code></pre>