Trying to find a quick way to get windows path
<p>I'm new to python.
I know how to detect which os is installed but I'm trying to find a quick way to get the windows path rather then go a-z (c:\windows...x:\windows...).
Is there any quick way?</p>

<p>Edit:
Something like %systemroot% in windows (gives you full path).</p>

<p>You can use <a href="https://docs.python.org/3/library/os.html#os.environ" rel="nofollow"><code>os.environ</code></a></p>

<pre><code>import os
win_path = os.environ['WINDIR']
</code></pre>

<p><code>WINDIR</code> is an environment variable set by windows that will point to <code>%SystemRoot%</code></p>

python windows