From c7464b41214c461bad3df2a54fb82da777dbc0d6 Mon Sep 17 00:00:00 2001 From: jerome Date: Fri, 4 Jul 2025 12:33:40 +0200 Subject: chat socket --- chat_client.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'chat_client.py') diff --git a/chat_client.py b/chat_client.py index 3b3c082..88bb7ae 100644 --- a/chat_client.py +++ b/chat_client.py @@ -1,15 +1,13 @@ #!/usr/bin/env python3 -import sys,socket,os +import sys,socket def chat_client(host,port): - whoami = os.getenv("USER") try: s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.connect((host,port)) while True: - message = input("moi > ") - message = whoami+" > "+message + message = input() s.sendall(message.encode()) data = s.recv(1024) print(data.decode()) -- cgit v1.2.3