python import nested class
<p>I'm new to python. This is not my actual case, it's just my curiosity about importing nested class.</p>
<p>So I have a <strong>main.py</strong> and <strong>test.py</strong>.</p>
<p><strong>test.py</strong>:</p>
<pre><code>class one():
   class two():
      def twodef():
         pass
</code></pre>
<p>so in my <strong>main.py</strong>, I can do <code>'import test'</code> or <code>'from test import one'</code>. But I got error when do: <code>'from test.one import two</code>'.</p>
<pre><code>error : ImportError: No module named one
</code></pre>
<p>Anyone can explain this?</p>