I have a command that provides event stream - new message every few second. How do I read this as it comes with python?
The standard approach with
def getMessage(command):
lines = os.popen(command).readlines()
return lines
waits for the command to complete, but in this command run forever. It will continue on and print new message to stdout every few seconds. How do I pass it on to python? I want to capture all messages in the stream.