import socket
#1:创建socket
client=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
#2:链接(用tuple写)
client.connect(('192.168.0.103',8080))
#3:发送数据
while True:
data=input('请输入给服务器发送的数据,输入#结束')
if not data=='#':
client.send(data.encode('utf-8'))
info=client.recv(1024).decode('utf-8')
print('服务器说:',info)
else:
break
client.close()