Template
XLSX_FIlE = "../../XX.xlsx"
NUM_SHEETS = 3
# 获取.xlsx文件的所有sheet列表
workbook = load_workbook(XLSX_FIlE)
sheets = workbook.get_sheet_names()
tmp_dict = {}
# 分别获取每个sheet的内容
for i in range(NUM_SHEETS):
booksheet = workbook.get_sheet_by_name(sheets[i])
rows = booksheet.rows
for row in rows:
key, value = [col.value for col in row][:2]
tmp_dict[key] = value