Python XLWT无法指定行高

R. *_*ark 6 python xlwt

我正在尝试使用xlwt和row.(i).高,但我没有结果.

我的代码:

import xlwt
book = xlwt.Workbook(encoding='latin-1')
sheet = sheet.add_sheet('KPI.TiempoRespuesta',cell_overwrite_ok=True)
sheet.write(1, 4, "BLABLABLABLABLABLABLABLABLABLABLABLA")
sheet.row(4).height = 256*20
book.save("book.xls")
Run Code Online (Sandbox Code Playgroud)

我想增加单元格高度; /,但行.(i).高不做任何事情

iMo*_*om0 21

您应该告诉xlwt行高和默认字体高度不匹配:

sheet.row(4).height_mismatch = True
sheet.row(4).height = 256*20
Run Code Online (Sandbox Code Playgroud)