title: python subprocess updates its lines (\r) - i need every update
body: <p>As suggested in an answer to my question "<a href="https://stackoverflow.com/questions/26006744/python-start-terminal-program-and-parse-its-output-while-its-running">Python: start terminal program and parse its output while it's running</a>" i am using a subprocess construct to communicate with a program:</p>
  
  <pre><code>server = subprocess.Popen(["meteor", "--port",  port], stdout=subprocess.PIPE)
  
  for line in iter(server.stdout.readline, ""):
    # Do something for example
    print(line)
  </code></pre>
  
  <p>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. </p>
  
  <p>But i want to react on every line update. So I want to handle <code>\r</code> like <code>\n</code> and not just iterate over finished lines, i want to iterate over the available string until the next "pause" wether it is a <code>\r</code> or <code>\n</code> or another line break to get the information directly when it appears, not only when the server sends a <code>\n</code>. How can i do that?</p>