Jython

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Sat Feb 3 13:01:23 EST 2007


gregt... at mindspring.com:
> Files aren't lists and thus don't have the functions for iteration.
> Try:
> def go():
>         for line in open("bobo.txt", "r").readlines():
>                 print line
> go()

CPython 2.1 has xreadlines, maybe Jython has it too.

Bye,
bearophile




More information about the Python-list mailing list