title: Python - Undefined class name after dynamic import
body: <p>I'm using Python for a weeks now and i'm confronted to an issue with dynamic import.
  I have a file Test.py that in which a class is defined. I would like to use this class after the dynamic import of Test.py from another file.</p>
  
  <p>My final goal is more complex but I simplified it but i still get the same problem.</p>
  
  <p>File : Test.py</p>
  
  <pre><code>class Test :
      def __init__ ( self ) :
          print ( "instance" )
  </code></pre>
  
  <p>File : Main.py</p>
  
  <pre><code>def allImports ( ) :
      __import__ ( "Test" )
  </code></pre>
  
  <p>What i get :</p>
  
  <pre><code>&gt;&gt;&gt; import Main
  &gt;&gt;&gt; Main.allImports()
  &gt;&gt;&gt; myInstance = Test ()
  Traceback (most recent call last):
     File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  NameError: name 'Test' is not defined
  </code></pre>
  
  <p>I cannot specify in the fromlist which element from Test.py i have to import because i'm not supposed to know them.</p>
  
  <p>What should i do ?</p>