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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.