python - space in folder name : <p>I have this next bit of code</p>

<pre><code>Path = os.getenv('PATH')
Path = Path.split(';')
for i, p in enumerate(Path):
    if len(P) != 0 and p[-1] != "\\":
        Path[i] = p + "\\" #this adds '\' to the ending of each line
</code></pre>

<p>printing
<code>Path[0]</code> will show</p>

<p><code>C:\Program Files (x86)\Common Files\Oracle\Java\javapath\</code></p>

<p>However, When I try to run anything from this folder, I get the error</p>

<p><code>'C:\Program' is not recognized</code></p>

<p>How can I make it search in the entire path and not stop at the space?</p>
