This is the code I have written:
import os
s=""
pr=""
x=""
i=0
for (p,d,f) in os.walk('d:\\12'):
i+=1
if i <= 3:
pr=str(p)
s=str(d)
s=s.strip("[]")
e=(len(s.strip("\'\'")))
#print(s,e)
x=str(f).strip("[]")
y=pr+"\\"+x.strip("\'\'")
print(y)
This is it's output: d:\12\bvzcasdas\14\hello.txt What I want as the result is the drive letter & the immediate sub-directory (i.e 12) should be skipped in the final result.