我尝试在python中确定行中的条目是否为粗体。但是xf_index的返回值是none。如何确定单元格是否为粗体?
import xlrd
fileLocation = "location"
workbook = xlrd.open_workbook(fileLocation)
sheet = workbook.sheet_by_index(0)
workbook.formatting_info = True
for row in range(sheet.nrows):
if sheet.cell_value(row,4)!= "" :
currentRow = row
currentCell = sheet.cell(currentRow,4)
#print(sheet.cell(currentRow,4).xf_index) -> returns none
attributeName = sheet.cell_value(row, 4)
attributeValue = sheet.cell_value(row,8)
line = "["+attributeName+ attributeValue+"]"