Permanently adding to %PATH% from Python
<p>For some reason I have to write Python for Windows (extremely tedious), and can't find a way to append the script's current directory to the PATH environment variable.</p>

<p>I know about</p>

<pre><code>import os
os.environ["PATH"] += os.pathsep + &lt;current_directory&gt;
</code></pre>

<p>but this doesn't do it for me since the change is not permanent.</p>

<p>All the answers point to changing the PATH by using the GUI (System > Advanced System Settings > Environment Variables). I want to automate my tool as much as possible so the user only has to run the <code>config.py</code> file and start working, without worrying too much about path variables.</p>

<p>On Linux I just wrote to .bashrc and sourced the file. How can I do this in Windows?</p>