我正在使用单个单元格为文本着色
worksheet.write(1, 1, "This is a row 1, column 1", xlwt.easyxf("font: color blue;"))
worksheet.write(1, 2, "This is a row 1, column 2", xlwt.easyxf("font: color blue;"))
worksheet.write(1, 3, "This is a row 1, column 3", xlwt.easyxf("font: color blue;"))
可以这样做,以便单个操作可以改变行文本的整个颜色。
答案 0 :(得分:0)
如果您的意思是想要循环更改语句:
for index in xrange(1, 4):
worksheet.write(1, index, "This is a row 1, column %d" % index,
xlwt.easyxf("font: color blue;"))
答案 1 :(得分:0)
for col in range(1,4):
worksheet.write(1, col, "This is a row 1, column "+str(col), xlwt.easyxf("font: color blue;"))