On 10/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:
Send Tutor mailing list submissions to
         tutor@python.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.python.org/mailman/listinfo/tutor
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tutor digest..."


Today's Topics:

   1. Re: Tutor Digest, Vol 32, Issue 49 (Alan Gauld)


----------------------------------------------------------------------

Message: 1
Date: Fri, 13 Oct 2006 10:09:04 +0100
From: "Alan Gauld" <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Tutor Digest, Vol 32, Issue 49
To: tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
        reply-type=original


"Meher Kolli" <[EMAIL PROTECTED]> wrote in message

> You can't  add  \n  to  a string ..up have  use something like this
>
>   if str == 'q':
>       done = 1
>       fd.close()
>   else:
>       fd.write("%s \n" %(str))

What makes you think so?

>>> s = 'l'
>>> s += '\n'
>>> s
'l\n'
>>>

Seems to work.... '\n' is just a character like any other.

The issue was to have a newline or  return  character after  every string,  Here it is just iterpreted as \n alphabet., but  not as a return character.

--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld



------------------------------

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


End of Tutor Digest, Vol 32, Issue 51
*************************************



--
Meher Kolli
Sunnyvale,CA-94085
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to