Using python to write text files with DOS line endings on linux,f.write('foo\nbar\nbaz\n')