[Tutor] Append mode dilemma

Alan Gauld alan.gauld at btinternet.com
Thu Dec 10 01:04:39 CET 2009


"Lie Ryan" <lie.1296 at gmail.com> wrote

> with open(...) as fobj:
>     entry = ''
>     while entry != '.'
>         fobj.write(raw_input())

But how does entry change in this example?
I think you need

with open(...) as fobj:
     entry = ''
     while entry != '.'

         fobj.write(entry)

         entry = raw_input()



-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list