xlrd的:
sExcelFile = luJing + "\物料名称.xls"
self.file = sExcelFile
self.data = xlrd.open_workbook(self.file,formatting_info=True)#formatting_info=True 不知道xlsx格式
self.table = self.data.sheet_by_name('Sheet1')
nrows = self.table.nrows print(nrows) return nrows
openxlpy的:
sExcelFile = luJing+"\物料名称.xlsx" wb = load_workbook(sExcelFile)#, data_only=True ws = wb["Sheet1"] rows = ws.max_row print(rows)
比如:原来我有5行数据,我删掉最后一行(期望返回4行数据),可是这两个包,仍然返回5行数据。真是奇怪,难道修改了excel,看不见?没人注意这个事吗?

2982

被折叠的 条评论
为什么被折叠?



