[Tutor] Tutor Digest, Vol 32, Issue 51
Meher Kolli
meherkp at gmail.com
Fri Oct 13 18:12:31 CEST 2006
On 10/13/06, tutor-request at python.org <tutor-request at python.org> wrote:
>
> Send Tutor mailing list submissions to
> tutor at 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
> tutor-request at python.org
>
> You can reach the person managing the list at
> tutor-owner at python.org
>
> 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" <alan.gauld at btinternet.com>
> Subject: Re: [Tutor] Tutor Digest, Vol 32, Issue 49
> To: tutor at python.org
> Message-ID: <egnl3i$f1f$1 at sea.gmane.org>
> Content-Type: text/plain; format=flowed; charset="iso-8859-1";
> reply-type=original
>
>
> "Meher Kolli" <meherkp at gmail.com> 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 at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
> End of Tutor Digest, Vol 32, Issue 51
> *************************************
>
--
Meher Kolli
Sunnyvale,CA-94085
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061013/0f750b22/attachment.html
More information about the Tutor
mailing list