urcontrol/tests/socketsendtest.py
2022-05-31 15:26:53 +02:00

17 lines
234 B
Python

import socket
import time
TCP_IP = '127.0.0.1'
TCP_PORT = 30002
message = "12.3,20.15"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
time.sleep(1)
s.send(message.encode('utf-8'))
s.close()