As suggested in an answer to my question "Python: start terminal program and parse its output while it's running" i am using a subprocess construct to communicate with a program:
server = subprocess.Popen(["meteor", "--port",  port], stdout=subprocess.PIPE)
for line in iter(server.stdout.readline, ""):
  # Do something for example
  print(line)
The problem is: The subprocess (server) does not end each line with a newline directly as it is putting a (x2) at the end of a line, when the message duplicates.
But i want to react on every line update. So I want to handle \r like \n and not just iterate over finished lines, i want to iterate over the available string until the next "pause" wether it is a \r or \n or another line break to get the information directly when it appears, not only when the server sends a \n. How can i do that?
 
     
    