Replace sys.stdout to use backslashreplace. Use '\n' newline on all operating systems.
Attach a file by drag & drop or click to upload