0

I am working on Windows 11 with python3 from activestate and I want to write a python script which prints shell commands to stdout which then could be run on Linux or on windows with cygwin.
Printing to stdout on Windows automatically converts \n to \r\n which in my case is really annoying.
I know that I can pipe the stdout to dos2unix or open a file in my python script and write to it with newline set to \n.
What I am looking for though is a way to tell python that I want to print to stdout without any automagic conversion of \n into \r\n.
Is there an easy way to achieve this?

user333869
  • 549
  • 1
  • 4
  • 13

0 Answers0