sub = ctx.socket(zmq.SUB)
url = 'tcp://127.0.0.1:5555'
pub.bind(url)
sub.connect(url)
sub.setsockopt(zmq.SUBSCRIBE, 'a')
sub.setsockopt(zmq.SUBSCRIBE, 'b')
time.sleep(1)
for word in ['alpha', 'beta', 'gamma', 'apple', 'carrot', 'bagel']:
    pub.send(word)
time.sleep(1)
for i in range(4):
    pass
ZeroMQ and multiple subscribe filters in Python