sendData = input("please say something:") if sendData != 'bye': udpSocket.sendto(sendData.encode("gbk"), sendAddr) recvData = udpSocket.recvfrom(1024) print(bytes(recvData[0]).decode("gbk"))
python3网络编程乱码问题解决
最新推荐文章于 2021-08-04 23:26:40 发布
sendData = input("please say something:") if sendData != 'bye': udpSocket.sendto(sendData.encode("gbk"), sendAddr) recvData = udpSocket.recvfrom(1024) print(bytes(recvData[0]).decode("gbk"))