【发布时间】:2019-10-22 12:58:17
【问题描述】:
我在尝试获取 excel 表中的行数时遇到属性错误。我在 python 中使用了 openpyxl 库
这是使用的python 3x版本和openpyxl最新版本
导入openpyxl 从 openpyxl 导入 load_workbook wb=load_workbook("automation-book-example.xlsx")
获取表格
ws=wb.get_sheet_by_name('Sheet1')
打印(ws.get_highest_row())
Traceback(最近一次调用最后一次): 文件“C:\Users\kamaraj\Desktop\python-excel\openpyxl\automation-book-example.py”,第 9 行,在 打印(ws.get_highest_row()) AttributeError:“工作表”对象没有属性“get_highest_row”
【问题讨论】:
标签: python python-3.x openpyxl