How to change the color based on text in excel using Python?
In Excel cell text will vary from Pass to Fail.I have to give background color green for Pass(pass/Passed/passed) and red for Fail(fail/Failed/failed) respectively. How to change the color based on text ? My Script import xlwt workbook = xlwt.Workbook() worksheet = workbook.add_sheet('Testing') worksheet.write_merge(5, 5, 1, 1,'S.No') worksheet.write_merge(5, 5, 2, 2,'Test Case Description') worksheet.write_merge(5, 5, 3, 3,'Status') worksheet.write_merge(5, 5, 4, 4,'Remarks') worksheet.write_merge(6, 6, 1, 1,1) worksheet.write_merge(7, 7, 1, 1,1) worksheet.write_merge(6, 6, 2, 2,'Verify