02 socketserver客户端

import socket
client = socket.socket()
client.connect(('127.0.0.1',8001))

while 1:
    msg = input('客户端说>>>')
    client.send(msg.encode('utf-8'))

    from_server_msg = client.recv(1024)

    print(from_server_msg.decode('utf-8'))

 

posted on 2019-01-07 21:49  =.===  阅读(136)  评论(0编辑  收藏  举报

导航