From a854977fedbea77f2235c01748851c3f3b5986b6 Mon Sep 17 00:00:00 2001 From: Drac0 Date: Mon, 4 May 2026 11:15:59 +0300 Subject: [PATCH] tcp client --- tcp_client.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tcp_client.py diff --git a/tcp_client.py b/tcp_client.py new file mode 100644 index 0000000..8bf9fdd --- /dev/null +++ b/tcp_client.py @@ -0,0 +1,12 @@ +import socket + +client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +client.connect(('127.0.0.1', 10000)) + +message = input("Введите сообщение: ") +client.sendall(message.encode()) + +data = client.recv(1024) +print(f"Ответ от сервера: {data.decode()}") + +client.close() \ No newline at end of file