一些常用的excel方法
import openpyxl
# 打开文件
wb = openpyxl.load_workbook(r'example.xlsx')
# 切换表
s1 = wb.get_sheet_by_name('Sheet2')
# 当前编辑的表
act = wb.get_active_sheet()
# 所有的表名,以列表的方式保存的
wb.get_sheet_names()
# Sheet2表中A1单元格中的值
s1['A1'].value
print(s1.cell(row=1, column=1).value)
# Sheet2中最大行数 之前方法为s1.get_highest_row()
s1.max_row
# Sheet2中最大列数 之前方法为s1.get_highest_column()
s1.max_column
# 表中第一行所有数据,保存在generator中
s1.rows[1]