11 lines
261 B
Python
11 lines
261 B
Python
import socket
|
|
|
|
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
message = b'hello server'
|
|
client.sendto(message, ('127.0.0.1', 15000))
|
|
|
|
data, server_addr = client.recvfrom(1024)
|
|
print(f"Ответ от сервера: {data.decode()}")
|
|
|
|
client.close()
|