tcp client

This commit is contained in:
Drac0 2026-05-04 11:15:59 +03:00
parent abcfe1aa47
commit a854977fed

12
tcp_client.py Normal file
View File

@ -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()