2013-12-16 61 views
6

我想用行xlwt。(i).height,但我沒有結果。Python XLWT不能指定行高

我的代碼:

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).height無能爲力

回答

17

你應該告訴xlwt行高度和默認的字體高度不匹配:

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

完美!謝謝! –

+0

謝謝iMom0 .. :) –