12 lines
313 B
Python
12 lines
313 B
Python
import socket
|
|
|
|
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
client.connect(('127.0.0.1', 10000))
|
|
|
|
message = input("Введите сообщение: ")
|
|
client.sendall(message.encode('utf-8'))
|
|
|
|
data = client.recv(1024)
|
|
print(f"Ответ от сервера: {data.decode('utf-8')}")
|
|
|
|
client.close() |