new linereading standard?

Robin Becker robin at jessikat.demon.co.uk
Tue Apr 25 09:02:29 CEST 2000


In article <390510C9.A744D22E at yahoo.com>, Al-Amerrho H. Amerin
<al_amerin at yahoo.com> writes
>Pete Shinners wrote:
>
>>
.....
>_
>>    pete at visionart.com
>
>A beginner myself, I would write it like this:
>
>inputlines = open('myfile.txt').readlines()
>for line in inputlines:
>    print line
>
>Instead of the 'while 1: ....break' thingy.
>
>Al-
>

am I wrong for writing

for line in open('myfile.txt').readlines():
    print line

-- 
Robin Becker



More information about the Python-list mailing list