On Apr 3, 12:26 pm, "7stud" <[EMAIL PROTECTED]> wrote: > The file.writelines() documentation says that it > doesn't add line separators. Is adding a carriage return something > different?
No. > Is this expected behavior? According to Python in a Nutshell(p. 217), it is. On windows, in text mode, when you write a \n to a file, the \n is converted to the system specific newline (which is specified in os.linesep). For windows, a newline is \r\n. Conversely, on windows, in text mode, when you read a \r\n newline from a file, it is converted to a \n. I forgot to add that when you read or write in binary mode, no conversion takes place. So, if you read \r\n from the file, your input will contain the \r\n; and if you write \r\n to the file, then the file will contain \r\n. -- http://mail.python.org/mailman/listinfo/python-list