openpyxl在不修改窗体的情况下更改单元格的内容

2024-10-02 18:19:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要写在现有的Excel文件,保持单元格格式

for clave,valores in dicreportescapturados.items():
        columnceldadestino=1
        for dato in valores:
            ws1.cell(filaceldadestino,columnceldadestino).value = dato
            columnceldadestino += 1
        filaceldadestino += 1

在这段代码中,我丢失了格式,所有写入的单元格都变成了“常规”格式:(()

有人能帮我吗


Tags: 文件inforvalue格式cellitemsexcel