openpyxl python中对于excel的处理有很多第三方库可以使用,这里选取openpyxl 基本操作 接下来展示最基本的生成和读取excel代码: import openpyxl # 读取excel file_path = "demo.xlsx" wb = openpyxl.load_workbook(file_path) ws = wb.active for row in ws.iter_rows(): for cell in row: print(cell.value)