import socket


s = socket.socket()
host = socket.gethostbyname('localhost')
port = 22225

s.connect((host, port))

#s.send(message.encode('utf-8'))
#bytes = s.recv(1024)
#print (bytes.decode('utf-8'))
#s.close()
message = 'hi'
while message != 'STOP':
    message = input('eingabe:  ')
    s.send(message.encode('utf-8'))
    bytes = s.recv(4096)
    print(bytes.decode('utf-8'))
else:
    s.close()