import socket ip = input("Ip Adresse: ") s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((ip, 4950)) while True: if s.connect: print("Connected...") else: print("Verbindung fehlgeschlagen") try: while True: nachricht = input("Nachricht: ") s.send(nachricht.encode()) antwort = s.recv(1024) print("[{}] {}".format(ip, antwort.decode())) finally: s.close() input()