13 lines
300 B
Python
13 lines
300 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())
|
|
|
|
data = client.recv(1024)
|
|
print(f"Ответ от сервера: {data.decode()}")
|
|
|
|
client.close() |