您的位置:首页 > 编程语言 > Python开发

Python List find方法报错 TypeError: 'str' does not support the buffer interface

2016-06-26 20:22 931 查看
deviceList[1].find('device') 

List使用find方法时,报错误:

TypeError: 'str' does not support the buffer interface

In python 3, bytes strings and unicodestrings are now two different types. Bytes
strings are b"" enclosed strings

上述语句改为:deviceList[1].find(b'device') 就好了,加了个小b
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Python3