QND_secure_chat/client.py

15 lines
284 B
Python
Raw Normal View History

2024-09-11 18:17:11 +00:00
import socket
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(("localhost", 9999))
done = False
while not done:
client.send(input("message: ").encode('utf-8'))
msg = client.recv(1024).decode('utf-8')
if msg != "quit":
print(msg)
else:
done = True