If you want only the name of the folder that is the immediate parent of the file provided as an argument and not the absolute path to that file:
os.path.split(os.path.dirname(currentDir))[1]
i.e. with a currentDir
value of /home/user/path/to/myfile/file.ext
The above command will return:
myfile