Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to obtain cell background color using xlrd?

I have a long column, whose values are read using a python script. Additionally I need to print the color of the cell background (Even HEX code is fine). But my program says "Sheet has no attribute as cell_color. My code is as follows. please help

import xlrd

wb = xlrd.open_workbook("Test.xlsx")
sheet = wb.sheet_by_index(0)

for i in range(sheet.nrows):
    print (sheet.cell_value(i,0), sheet.cell_color(i,0))

Comments