you could do `sys.stdout.write(line)` and avoid having to take out the line endings because `sys.stdout.write` doesn't add the newlines like `print` does