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