def replace_extension(file_path, extension):
    """Generate a new file path from existing file path and new extension """
    split_path = file_path.rsplit(".", 1)
    return ".".join([split_path[0], extension])