python xlwt set custom background colour of a cell

前端 未结 5 1426
迷失自我
迷失自我 2020-12-08 21:04

I am using python 2.7 and xlwt module for excel export

I would like to set backgroung colour of a cell i know i can use

style1 = xlwt.easyxf(\'patter         


        
5条回答
  •  遥遥无期
    2020-12-08 21:43

    For predefined colors see xlwt.Style._colour_map_text in Style.py.

    To use custom colors you will have to probably redefine palette, because colors are not used directly in cells but as a index to color in a palette. I don't know how to extend palette. Sorry.

提交回复
热议问题