1. 使用pandas
import pandas
file_path = '1.xlsx'
xls = pandas.ExcelFile(file_path)
sheet_names = xls.sheet_names
2. 使用openpyxl
import openpyxl
file_path = '1.xlsx'
xls = openpyxl.load_workbook(file_path)
sheet_names = xls.sheetnames
来自:https://blog.csdn.net/hj009zzh/article/details/112316560
|