运行报错提示
import xlrd d1 = xlrd.open_workbook('dat1.xlsx') print(d1.sheet_loaded(0)) d2 = xlrd.open_workbook("C:\Users\wangming\Desktop\dat2.xlsx") print(d2.sheet_loaded(0))
运行结果
"F:\Program Files (x86)\python\python.exe" E:/python实操/index.py
File "E:/python实操/index.py", line 4
d2 = xlrd.open_workbook("C:\Users\wangming\Desktop\dat2.xlsx")
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape