title: Python Namespaces and Modules
body: <p>If I import a python module using a syntax like this:</p>
  
  <pre><code>import my_module
  </code></pre>
  
  <p>I can later use a number of simplest command to get an idea of what the module is, where it is located and etc. For example:</p>
  
  <pre><code>print(my_module) 
  </code></pre>
  
  <p>outputs: module 'my_module' from 'my_module.py'</p>
  
  <pre><code>dir(my_module)
  </code></pre>
  
  <p>outputs: ['MyClass', '<strong>builtins</strong>', '<strong>doc</strong>', '<strong>file</strong>', '<strong>name</strong>', '<strong>package</strong>', 'math', 'os', 'sys']</p>
  
  <p>I even can find out an absolute path of the module by using:</p>
  
  <pre><code>print os.path.abspath( my_module.__file__  )
  </code></pre>
  
  <p>outputs: /Users/julia/Documents/classes/my_module.py</p>
  
  <p>But if instead of import 'my_module' I would be using:</p>
  
  <pre><code>from my_module import MyClass
  </code></pre>
  
  <p>all I can is to:</p>
  
  <pre><code>print MyClass
  </code></pre>
  
  <p>which outputs: my_module.MyClass</p>
  
  <p>I do see MyClass came from my_module file. But unfortunately that is all I can get since none of the commands I used to use to get the info on module doesn't work. Here is use and their output:</p>
  
  <pre><code>print dir(my_module.MyClass)  NameError: name 'my_module' is not defined
  
  print dir(my_module)  NameError: name 'my_module' is not defined
  
  print my_module  name 'my_module' is not defined
  </code></pre>
  
  <p>What command(-s) should I be using while tracking down the imported modules brought with </p>
  
  <pre><code>from my_module import MyClass
  </code></pre>
  
  <p>syntax?</p>