Python XLWT can not specify row height

R. Stark picture R. Stark · Dec 16, 2013 · Viewed 8.6k times · Source

I'm trying to use xlwt with row.(i).height, but I had no result.

My Code:

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")

I want to augment cell height ;/, but row.(i).height do nothing

Answer

iMom0 picture iMom0 · Dec 16, 2013

You should tell xlwt row height and default font height do not match:

sheet.row(4).height_mismatch = True
sheet.row(4).height = 256*20