mirror of
https://github.com/titanscouting/tra-superscript.git
synced 2024-11-14 15:16:18 +00:00
14 lines
297 B
Python
14 lines
297 B
Python
|
import signal
|
||
|
import zmq
|
||
|
|
||
|
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||
|
|
||
|
context = zmq.Context()
|
||
|
|
||
|
socket = context.socket(zmq.SUB)
|
||
|
socket.connect('tcp://localhost:5678')
|
||
|
socket.setsockopt(zmq.SUBSCRIBE, b'status')
|
||
|
|
||
|
while True:
|
||
|
message = socket.recv_multipart()
|
||
|
print(f'Received: {message}')
|