复制代码 代码如下:import socket#socket通信客户端def client(): mysocket=socket.socket(socket.AF_INET,socket.SOCK_STREAM) mysocket.connect((‘127.0.0.1’,8000)) mysocket.send(‘hello’) while 1: data=mysocket.recv(1024) if data: print data else: break mysocket.c