openpyxl设置列宽
如下
from openpyxl import Workbook
from openpyxl.utils import get_column_letter
wb=Workbook()
wb.create_sheet("log")
sheet1=wb["log"]
m=3
n=4
sheet1.cell(m,n).value="test"
sheet1.column_dimensions[get_column_letter(n)].width=50 #设置n列的列宽为50,这个列可以跟上面的cell对应上
wb.save("log.xlsx")