我使用下面的代码来读取excel,是否可以只读单元格" C13"或" A9"
file = self.excel_file.decode('base64')
excel_fileobj = TemporaryFile('wb+')
excel_fileobj.write(file)
excel_fileobj.seek(0)
workbook = openpyxl.load_workbook(excel_fileobj, data_only=True)
sheet = workbook[workbook.get_sheet_names()[0]]
for row in sheet.rows:
print(row[1].value)
答案 0 :(得分:3)
你试过了吗?
print(str(sheet['C13'].value))
print(str(sheet['A9'].value))