title: python 2.7 os.path.dirname(__file__) returns empty string on Debian (works fine on Win7)
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7783308/os-path-dirname-file-returns-empty">os.path.dirname(__file__) returns empty</a>  </p>
  </blockquote>
  
  
  
  <p>Here's my piece of code:</p>
  
  <pre><code>def GetAppPath():
      application_path = None
      if getattr(sys, 'frozen', False):
          application_path = os.path.dirname(sys.executable)
      elif __file__:
          application_path = os.path.dirname(__file__)
      return application_path
  </code></pre>
  
  <p>Works perfectly on Windows, but returns empty string on Debian. Any ideas what could be the problem?</p>
  
  <p>I'm using Python 2.7.3, Debian 6.0.5</p>