Re: [Tutor] Cant write new line at end of file append

2007-12-21 Thread Tiger12506

- Original Message - 
From: "dave selby" <[EMAIL PROTECTED]>
To: "Python Tutor" 
Sent: Friday, December 21, 2007 12:03 PM
Subject: [Tutor] Cant write new line at end of file append


> Hi all,
>
> I need to write a newline at the end of a string I am appending to a
> file. I tried ...
>
> journal.write('%s#%s\n' % (jpeg[:-4], self.snap_init[feed]))
>
> The text is all there but no new line at the end  any idea what I
> am doing wrong ? ... thought \n would do it.
>
> Cheers
>
> Dave

Different operating systems deal with newline differently, and sometimes 
libraries are built upon the assumption that a particular operating system 
uses a particular style of newline. Have you tried \r\n? 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Cant write new line at end of file append

2007-12-21 Thread dave selby
Hi all,

I need to write a newline at the end of a string I am appending to a
file. I tried ...

journal.write('%s#%s\n' % (jpeg[:-4], self.snap_init[feed]))

The text is all there but no new line at the end  any idea what I
am doing wrong ? ... thought \n would do it.

Cheers

Dave


-- 

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor