how to get last folder name from path in python code example
Example: get last element path
>>> os.path.basename(os.path.normpath('/folderA/folderB/folderC/folderD/'))
'folderD'
>>> os.path.basename(os.path.normpath('/folderA/folderB/folderC/folderD/'))
'folderD'