OSError: [Errno 22] Invalid argument:

1.操作文件时,遇到类似:

OSError: [Errno 22] Invalid argument:

的错误。

注意不要只拷贝Windows下的目录分隔符。换成‘/’。或者使用“\\”如下:

b = xlrd.open_workbook('D:\\KwDownload\\song\\a.xlsx')

或者在'路径'前边加个r。

猜你喜欢

转载自blog.csdn.net/hebeiuniversityof/article/details/80026564
今日推荐