client.py 316 B

123456789101112131415
  1. import socket
  2. SERVER = "10.8.0.5"
  3. PORT = 7777
  4. client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  5. client.connect((SERVER, PORT))
  6. client.sendall(bytes("Черный треугольник жив!", "UTF-8"))
  7. while True:
  8. in_data = client.recv(4096)
  9. print("От сервера:" ,in_data.decode())