import ntpath


def path_leaf(path):
    """ Cross platform function to get the filename from any path. 
    
    Args:
        path (ste): A string path.
    
    Returns:
        str: the basename of the path
    """
    head, tail = ntpath.split(path)
    return tail or ntpath.basename(head)