python读取xlsx文件

import openpyxl
#打开excel文件,获取工作簿对象
dog_food = openpyxl.load_workbook('dog-food.xlsx')
#从工作薄中获取一个表单(sheet)对象
sheets = dog_food.sheetnames
print(sheets, type(sheets))
sheet1 = dog_food['Sheet1']
col_range = sheet1['A:B']
demand = []
for col in col_range: # 打印AB两列单元格中的值内容
    for cell in col:
        print(cell.value)
上一篇:微信小程序如何实现将数据导出生成excel


下一篇:node express 导入excel转成想要的excel格式下载