I am using Windows and python 3.6.1
import xlrd
workbook = xlrd.open_workbook("C:\Users*******\Desktop\excela.xlsx") sheet = workbook.sheet_by_index(0)
What is the error in the code?
I am using Windows and python 3.6.1
import xlrd
workbook = xlrd.open_workbook("C:\Users*******\Desktop\excela.xlsx") sheet = workbook.sheet_by_index(0)
What is the error in the code?
Backslash () is an escape code inside a double quoted string. Options: - Change to "\" so it produces a single unescaped backslash. - Change to single quotes. - Use forward slash (/) and let Python file handling translate to Windows conventions.
See this answer: Windows path in python