pythonxy path setting? Ask for help

Code:

from xlrd import open_workbook

input_file = 'e:\python\trade.xls'

open_workbook(input_file) Open a workbook

workbook = open_workbook(input_file)

Output how many sheets are in this workbook workbook.nsheets

print('Number of worksheets: ', workbook.nsheets)

result:

execfile(filename, namespace)

File "E:\python\program\rdxls.py", line 14, in

workbook = open_workbook(input_file)

File "C:\Python27\lib\site-packages\xlrd-1.2.0-py2.7.egg\xlrd_init_.py", line 111, in open_workbook

with open(filename, "rb") as f:

IOError: [Errno 22] invalid mode ('rb') or filename: 'e:\python\trade.xls'

If the prompt path is wrong, how to modify it, please give pointers. Spyder (phthon 2.7) version, the default path is installed. QQ:804876498

Recommended Posts

pythonxy path setting? Ask for help