def get_filename_from_path(path):
 (dirpath, filename) = ntpath.split(path)
 return (filename if filename else ntpath.basename(dirpath))

def get_filename_from_path ( path ) : ( dirpath , filename ) = ntpath . split ( path ) return ( filename if filename else ntpath . basename ( dirpath ) )
cross-platform filename extraction from path .