截至目前,我可以阅读 EXCEL 文件的所有表格。
e.msgbox("select Excel File")
updated_deleted_xls = e.fileopenbox()
book = xlrd.open_workbook(updated_deleted_xls, formatting_info=True)
openfile = e.fileopenbox()
for sheet in book.sheets():
for row in range(sheet.nrows):
for col in range(sheet.ncols):
thecell = sheet.cell(row, 0)
xfx = sheet.cell_xf_index(row, 0)
xf = book.xf_list[xfx]
原文由 user3698866 发布,翻译遵循 CC BY-SA 4.0 许可协议
如果您从桌面或命令行打开编辑器,则在尝试读取文件时必须指定文件路径:
或者,如果您在文件目录中打开编辑器,则可以直接使用 panda 库进行读取