Created
May 27, 2014 10:39
-
-
Save sjaensch/106e2e1c63adc2379b10 to your computer and use it in GitHub Desktop.
xlwt row height example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import xlwt | |
def wraptest(): | |
wb = xlwt.Workbook() | |
sty = xlwt.XFStyle() | |
al = xlwt.Alignment() | |
al.wrap = xlwt.Alignment.WRAP_AT_RIGHT | |
sty.alignment = al | |
ws = wb.add_sheet('x') | |
strg = "very very very very very very very long string to test the auto resizing feature" | |
ws.write(0, 0, strg, sty) # row's height is adjusted correctly | |
ws.write(1, 0, strg, sty) # row's height is not adjusted! | |
wb.save('wraptest.xls') | |
if __name__ == "__main__": | |
wraptest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment