get last element path 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'