Python Excel处理库openpyxl使用

基础知识

workbook:excel工作表
sheet:工作表中的一个表
cell:其中的一个单元格
步骤:打开workbook --》选中sheet–》操作cell

from openpyxl import load_workbook
# 1.打开excel,默认可读写,若有需要可以指定write_only和read_only为True
wb=load_workbook("pythonexcel练习.xlsx")#Open the given filename and return the workbook

# 2.定位表单
sheet=wb["python练习1"]#传表单名,返回一个表单对象
# 3.定位单元格 行列值
res=sheet

你可能感兴趣的:(python接口测试,python,excel)