title: How to determine config file path in python?
body: <p>I have a module that needs to initialize some settings by reading a config file. The directory structure looks something like this:</p>
  
  <pre><code>root\
      config\
          conf.cfg
      src\
          module1.py
  </code></pre>
  
  <p>I'm fine when I set the relative path to <code>../config/conf.cfg</code> and run the module in its current directory. But when I import the module somewhere else and run it in another directory I run into problems.</p>
  
  <p>How should I set the path so the module always looks in the same relative location (eg one directory up from where the module is located) and how do I ensure this works for other people that download my repo (who may not have root in the same place)?</p>