Entry
How do I place a newline into the win32file.WriteFile (wHandle, string) method?
May 18th, 2000 07:48
unknown unknown, Laurent POINTAL
A solution which works for all platforms:
import os
...#open the file in binary mode.
file.write(os.linesep)
If you have opened your file with the text mode, then an \n is
normally translated into a \r\n when writing to the file (and reverse
when reading). Maybe it works also for the Macintosh (translating \n
to \r and reverse).
[Note: os miscellanenous system data allows you to relatively be
independant of host os -- see Help chapter 6.1.6]