BIG problem if readline strips newlines

Pete Shinners shredwheat at mediaone.net
Wed Jun 13 11:36:48 EDT 2001


"Aahz Maruch" <aahz at panix.com> wrote
> >for line in file.readlines(chomp=1):
> >    pass
>
> Um.  Think again?  Why wouldn't this work?

doh, right, my "C" brain took over here, i was
thinking the other method wouldn't work and somehow
both looping methods turned on in my brain...

i guess there would just be a problem with the
while 1 idiom

  while 1:
    line = file.readline(chomp=1)
    if not line: break

not as big a problem as i originally thought. not with
xreadlines and other new looping  methods that get us
away from the while 1 standard







More information about the Python-list mailing list