def get_basename(fileName):
 if fileName.endswith(os.path.sep):
  fileName = fileName[:(-1)]
 return os.path.basename(fileName)

def get_basename ( fileName ) : if fileName . endswith ( os . path . sep ) : fileName = fileName [ : ( - 1 ) ] return os . path . basename ( fileName )
get the name of a file or folder specified in a path .