"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.

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

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to