I have a root directory, which is for example ~/abc. To get the full path of this root directory, I am using
root_dir = os.path.expanduser('~/abc')
Within, abc, I have sub directories xyz and bin. To get the full paths of these, I am using
for path, dirs, files in os.walk(root_dir, topdown=False):
print path
I get the following output
/home/user/abc/xyz/bin
/home/user/abc/xyz
/home/user/abc
Now, suppose I want to extract only the full path of the bin, how do I go about?. I am not interested in the paths of xyz or abc
root_dirand loop it to show this output should get you again to do this with/home/user/abc/xyz/bin, what's the problem really?