import openpyxl |
workbook = openpyxl.load_workbook( 'example.xlsx' ) |
worksheet = workbook.active |
# 遍历所有单元格并读取数据 |
for row in worksheet.iter_rows(min_row = 1 , max_row = worksheet.max_row, |
min_col = 1 , max_col = worksheet.max_column): |
for cell in row: |
data = cell.value |
print (data) |