I have a program in python that prints out information about the file system... I need to know to save the name of the parent directory to a variable...
For example, if a tiny bit of the file system looked like this:
ParentDirectory
ChildDirectory
SubDirectory
If I was inside of ChildDirectory, I would need to save the name ParentDirectory to a certain string... here is some pseudo code:
import os
var = os.path.parent()
print var
On a side note, I am using Python 2.7.6, so I need to be compatible with 2.7.6...