import csv
if __name__ == "__main__":

    ddt_cases = []

    # 定义CSV文件的列名
    fieldnames = ['name', 'account', 'expected']

    # 将数据转换为适合写入CSV的格式
    rows = []
    for case in ddt_cases:
        row = [case['name']] + case['para']
        rows.append(row)

    # 写入CSV文件
    with open('textname.csv', mode='w', newline='', encoding='utf-8') as file:
        writer = csv.writer(file)
        writer.writerow(fieldnames)
        writer.writerows(rows)

    print("CSV文件已生成")