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