import openpyxl
# 读取excel文档
wb = openpyxl.load_workbook(‘shijuan/output.xlsx’)
# 获取工作表
sheet_1 = wb.get_sheet_by_name(‘Sheet‘)
DeprecationWarning: Call to deprecated function get_sheet_by_name (Use wb[sheetname]). sheet_1 = wb.get_sheet_by_name(‘Sheet‘)
最新版:
sheet_1 = wb[‘Sheet’]