import xlrd
book = xlrd.open_workbook("File_1.xls")
sheet = book.sheet_by_index(0)
print sheet.row_values(0)[0]
我正在尝试读取存储在系统(桌面)中的 excel 文件,相关的 excel 表只有一张表,当我运行代码时它给出了一个错误:-
Traceback (most recent call last):
File "C:/Python26/readingExlfiles.py", line 2, in <module>
book = xlrd.open_workbook("File_1.xls")
File "C:\Python26\Lib\site-packages\xlrd\__init__.py", line 449, in open_workbook
ragged_rows=ragged_rows,
File "C:\Python26\Lib\site-packages\xlrd\__init__.py", line 941, in biff2_8_load
f = open(filename, open_mode)
IOError: [Errno 2] No such file or directory: 'File_1.xls'
请帮助我。