title: python parent directory
body: <p>I want to get the parent directory of a file.
  This code doesn't work:</p>
  
  <pre><code>projectRoot = os.path.dirname(os.pardir(os.path.abspath(__file__)))
  </code></pre>
  
  <p>What's wrong?</p>
  
  <p>(I am developing a django application, and use this variable in the settings file of my application)</p>
  
  <p>Thanks.</p>
  
  <p>Romain</p>