尝试导入excel文件操作,编写了以下代码,
import xlrd
workbook = xlrd.open_workbook('D:ben.qinDesktop1.xls')
worksheets = workbook.sheet_names()
print('worksheets is %s' %worksheets)
报出以下错误,还请帮忙指点错误
runfile('D:/工具/Python/实例/读取文件.py', wdir='D:/工具/Python/实例')
Traceback (most recent call last):
File "", line 1, in
runfile('D:/工具/Python/实例/读取文件.py', wdir='D:/工具/Python/实例')
File "D:工具Anaconda3libsite-packagesspyderlibwidgetsexternalshellsitecustomize.py", line 699, in runfile
execfile(filename, namespace)
File "D:工具Anaconda3libsite-packagesspyderlibwidgetsexternalshellsitecustomize.py", line 88, in execfile
exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
File "D:/工具/Python/实例/读取文件.py", line 9, in
workbook = xlrd.open_workbook('D:ben.qinDesktop1.xls')
File "D:工具Anaconda3libsite-packagesxlrd__init__.py", line 394, in open_workbook
f = open(filename, "rb")
OSError: [Errno 22] Invalid argument: 'D:x08en.qin\Desktopx01.xls'