title: Confused about __import__ in Python
body: <p>I trying to import module by <code>__import__</code> like this:</p>
  
  <pre><code>&gt;&gt;&gt; mod = __import__('x.y.z')
  </code></pre>
  
  <p>But I only got <code>x</code>:</p>
  
  <pre><code>&gt;&gt;&gt; print mod
  &gt;&gt;&gt; &lt;module 'x' from '...'&gt;
  </code></pre>
  
  <p>How should I do to import <code>z</code> ? I tried like this, it works but i don't know why.</p>
  
  <pre><code>&gt;&gt;&gt; mod = __import__('x.y.z', {}, {}, [''])
  &gt;&gt;&gt; print mod
  &gt;&gt;&gt; &lt;module 'x.y.z' from '...'&gt;
  </code></pre>
  
  <p>I'm really confused about this, and I also have no idea with the <code>globals</code> and <code>locals</code> parameters.</p>
  
  <p>Thx a lot!</p>