generated from justuser-31/code_projects_template
20 lines
324 B
Python
20 lines
324 B
Python
import socket
|
|
|
|
# Create a socket object
|
|
s = socket.socket()
|
|
port = 12345
|
|
s.connect(('127.0.0.1', port))
|
|
|
|
data = '''{
|
|
"name": "Иван Иванов",
|
|
"age": 25,
|
|
"city": "Москва"
|
|
}'''
|
|
|
|
# Send data
|
|
s.send(data.encode())
|
|
# Receive data
|
|
print(f'STATUS: {s.recv(1024).decode()}')
|
|
|
|
s.close()
|