标签:python
在socket套接字模块进行send和recv方法时出现这种问题,是因为Python3.x和Python2.x版本变化,In python 3, bytes strings and unicodestrings are now two different types. 相互之间需要进行转换decode()和encode()。
send()需要的参数为bytes类型,因此需要对str进行encode()
recv()返回的是bytes类型,因此我们需要对返回的bytes进行decode()转换为str
Python错误:TypeError:'str' does not support the buffer interface
标签:python
原文地址:http://jdmylove.blog.51cto.com/9688344/1907655