socket-client
#!\usr\bin\env\python
# -*- coding:utf-8 -*9
import socket #导入模块
client=socket.socket() #声明socket类型,同时生成socket连接对象
client.connect=(('localhost',6969)) #连接端口
while True:
msg=inpuut(">>").strip() #输入值
if len(msg)==0:continue
client.send(msg.encode("utf-8")) #发送数据
data=client.recv(10240) #接收数据
print("recv:",data.decode()) #打印
client.close()