new linereading standard?

Robin Becker robin at
Tue Apr 25 03:02:29 EDT 2000

In article <390510C9.A744D22E at>, Al-Amerrho H. Amerin
<al_amerin at> writes
>Pete Shinners wrote:
>>    pete at
>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.

am I wrong for writing

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

Robin Becker

More information about the Python-list mailing list