在python3中,数据的网络传输只能传输二进制数据,所以bytes和str转化需要清楚: a = '你好' b =a.encode('utf-8') print(b) c=b.decode('utf-8') print(c) 结果: