title: Python how to not print \r and \n
body: <p>I have this code that runs a minecraft server from python and prints everything in the command line. However, at the end of every line it prints "\r\n" and I don't want it to, is there any way to get rid of it?</p>
  
  <pre><code>import subprocess
  
  def run_command(command):
      p = subprocess.Popen(command,
                       stdout=subprocess.PIPE,
                       stderr=subprocess.STDOUT)
      return iter(p.stdout.readline, b'')
  
  for output_line in run_command('java -Xmx2048M -Xms2048M -jar minecraft_server.jar nogui'):
      print(output_line)
  </code></pre>