How to append the project path across all source files in python(in most efficient way)?
<p>I have a directory structure for my project as </p>

<pre><code>&lt;some_path&gt;/code/project/
                        /conf
                        /data
                        /src/
                            a/x.py
                            b/
                             c/y.py
                            ... 
</code></pre>

<ul>
<li>each of x.py, y.py can run in isolation, so has to append the project path in its own script as  </li>
</ul>

<blockquote>
  <p>sys.path.append('~/code/project')</p>
</blockquote>

<ul>
<li><p>This becomes unmanageable when your code needs to run on multiple machines on cluster and I end up changing the paths manually :(</p></li>
<li><p>Its a bad design and I want to learn what is the best way to append the project </p></li>
<li><p>what is the best way to append the project path in this case so that </p>

<ul>
<li>I dont write  <code>sys.path.append</code> in each of the <code>.py file</code></li>
<li>I can define a master configuration that runs every time a <code>.py file</code> runs  </li>
</ul></li>
</ul>

<p>Thank you</p>
