我正在使用xlrd从excel工作表读取单元格值。我的代码如下,它以前工作得很好,但不知道在xlrd包中发生了什么变化,我得到了错误
“TypeError:open_workbook()获得意外的关键字参数'on'u demand'”
from xlrd import open_workbook
bench = open_workbook('excelsheet.xls',on_demand=True)
for name in bench.sheet_names():
sheetnew = bench.sheet_by_name(name)
for i in range(0, 13):
for cell in sheetnew.col(i):
print cell.value
bench.unload_sheet(name)
这解决了我的问题。可能对某人有帮助。在
相关问题 更多 >
编程相关推荐