0

error

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?

MLavoie
  • 9,671
  • 41
  • 36
  • 56
  • Hi there, welcome to Stack Overflow. Please take the time to go through the [welcome tour](https://stackoverflow.com/tour) to know your way arround here. Also I suggest you check how to [ask](https://stackoverflow.com/help/asking), specifically how to create minimal, complete and verifiable examples. These guidelines will help you get better answers in the future. Good luck with your coding! – DarkCygnus Jul 21 '17 at 04:27

1 Answers1

0

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