Install excel sheet in landscape mode with XLWT

I have a Python program that creates an excel sheet, but I was asked by one of the users to change it so that if it hit print, it would print in landscape mode, without having to specify it. Is there a way to set a sheet to an album in XLWT or some similar Python library for excel?

Thanks.

+6
python excel xlwt
source share
2 answers

With XLWT, I find it as simple as:

worksheetObject.portrait = False 
+7
source share

I think Mark's answer was valid with previous xlwt versions, it does not work with version 0.7.5. Instead, the following is done:

 sheet.set_portrait(False) 

Note that this is now a property of the sheet, not the entire book.

0
source share

All Articles