Parse directory path to a variable in python
<p>I want to parse to var and set what i parse to a variable 
I want to parse  <code>C:\\level1\\level2\\level3\\level4\\level5\\level6\\level7\\level8 and make it into</code>level7\level8`
currently i am able to get level7 only</p>

<pre><code>var = "C:\\level1\\level2\\level3\\level4\\level5\\level6\\level7\\level8"

split_path = os.path.split(os.path.split(var)[0])

print split_path
</code></pre>

<p>output below</p>

<pre><code>('C:\\level1\\level2\\level3\\level4\\level5\\level6', 'level7')
</code></pre>