I want to write text files with DOS/Windows line endings \'\\r\\n\' using python running on Linux. It seems to me that there must be a better way than manually putting a \'\\r\\
you can look at this PEP for some reference.
Update:
@OP, you can try creating something like this
import sys plat={"win32":"\r\n", 'linux':"\n" } # add macos as well platform=sys.platform ... o.write( line + plat[platform] )