openpyxl的读取单行表单内容
从excel取到的类型:数字还是数字,其他都是字符串
1、在桌面新建一个excel文件,复制到pychram中
2、导入excel
from openpyxl import load_workbook
3、打开excel--(“文件名”)---必须双引号,然后用wordbook来接收
wordbook1- = load_wordbook("test.xlsx")
4、定位表单 ,一共三个表单(test,sheel2,sheel3),定位test表单
sheet = wordbook["test"]
5、读取test表单中的内容---(行,列).内容
data1 = sheet.cell(1,1).value
data2 = sheel.cell(1,2).value
data3 = shelel.cell(1,3).value
data4 = sheel.cell(1,4).value
打印获取表单的内容
print("请求格式是:{},url是:{},data是:{},结果是:{}".forman(data1,data2,data3,data4))
获取最大行 max_row
print("最大行是{}".format(sheel.max_row))
获取最大列 max_column
print("最大列是{}".format(sheel.max_column))
openpyxl的读取excel中全部数据