- 导入模块
1)openpyxl
2)样式模块:from openpyxl.styles import Font, PatternFill, Border, Side, Alignment
- 设置excel完整路径:url=r’x:\xxx\xxx\x.xlsx’
- 加载工作簿:wordbook=openpyxl.load_workbook(url)
- 获取所有标签:sheet_names=workbook.get_sheet_names() 或workbook.sheetnames
- 指定sheet