import csv


def write_csv(file_path, data, delimiter=","):
    """Writes a nested list to a csv file

    Args:
        file_path (string): Absolute path of the file. Example:"C:/Users/Noctsol/Documents/somefile.csv"
        data (<list<list>>): Nested list of data. Example: [["header1", "header2"], ["val1", "val2"]]
        delimiter (str, optional): Delimiter of the the csv file. Defaults to ",".

    Returns:
        [type]: [description]
    """
    with open(file_path, 'w', encoding='UTF8', newline='') as file:
        writer = csv.writer(file, delimiter=delimiter)

        # write multiple rows
        writer.writerows(data)

        return True