#!/usr/bin/env python from sys import argv host = argv[1] if argv[1] else "127.0.0.1" serv = "tcp://" + host + ":5555" import zmq context = zmq.Context() print("Verbinde zu %s" % serv) socket = context.socket(zmq.SUB) socket.connect(serv) socket.setsockopt_string(zmq.SUBSCRIBE, "MSG") while True: line = socket.recv_string() print("< "+ line)