python能读取wps保存的表格吗
各位高手:在学习python的过程中,操作wps保存的表格,出现错误,pyhon不能处理wps文档吗?C:\Users\wang\PycharmProjects\pythonProject2\venv\Scripts\python.exe C:/Users/wang/PycharmProjects/pythonProject2/1.py
Traceback (most recent call last):
File "C:/Users/wang/PycharmProjects/pythonProject2/1.py", line 2, in <module>
workbook = xlrd.open_workbook('E:/lc/2.xlsx')
File "C:\Users\wang\PycharmProjects\pythonProject2\venv\lib\site-packages\xlrd\__init__.py", line 166, in open_workbook
file_format = inspect_format(filename, file_contents)
File "C:\Users\wang\PycharmProjects\pythonProject2\venv\lib\site-packages\xlrd\__init__.py", line 60, in inspect_format
with open(path, "rb") as f:
FileNotFoundError: No such file or directory: 'E:/lc/2.xlsx' 把代码附上来啊,不然怎么知道你哪里出问题 import xlrd
workbook = xlrd.open_workbook('E:/lc/2.xlsx')
print(workbook.sheet_names()) 路径不对吧 检查一下`E:/lc/2.xlsx`这个路径 你的路径不对头, / 应该改成 \ 不存在的话是不是要先创建此文件 import xlrd
workbook = xlrd.open_workbook('E:\lc\2.xlsx')
print(workbook.sheet_names()) 换pandas 简单几行代码,路径写法绝对正确,通过反复实验,wps保存的表格不能读取。
页:
[1]
2