string literals in windows dont show up!

Jonathan Gardner jgardn at
Thu Nov 22 02:09:43 CET 2001

Chris Fonnesbeck wrote:
> I am trying to append literals (i.e. \n, \r) to the end of lines in a
> text output file.  However, when the file is brought up in the windows
> notepad, there is no line feed or carriage return.  Any idea about how
> to make windows recognize these literals.  Works fine in linux (no big
> surprise there!)

Try "\r\n", not just "\n", and not just "\r". I remember I spent over three 
days trying to figure out how to get a newline appended to the rich text 
object in Win32.

Let's just say I swore never to program for win32 ever again.


More information about the Python-list mailing list