Text orientation on excel (single cell) in python

I am trying to write some data about an excel file and want to keep the text orientation of the first line as 90 degrees.

style = xlwt.easyxf('font: bold 0, color black, underline 0,height 250; alignment: horizontal left') 
+4
source share
1 answer

Here is an example of how you can do this:

 import xlwt style = xlwt.easyxf('align: rotation 90') workbook = xlwt.Workbook() worksheet = workbook.add_sheet('Test') worksheet.write(0, 0, label='Formatted value', style=style) workbook.save('test.xls') 

You can use the keyword rota or rotation .

FYI, the function under the hood is called here.

Hope this helps.

+5
source

All Articles