title: Finding a module's directory
body: <p>How can I find what directory a module has been imported from, as it needs to load a data file which is in the same directory.</p>
  
  <p>edit:</p>
  
  <p>combining several answers:</p>
  
  <pre><code>module_path = os.path.dirname(imp.find_module(self.__module__)[1])
  </code></pre>
  
  <p>got me what i wanted</p>