Need help on reading line from file into list

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Wed Apr 4 10:52:55 CEST 2007


Bruno Desthuilliers:
> result = [line.strip() for line in f.readlines()]

Probably better, lazily:
result = [line.strip() for line in infile]

Bye,
bearophile




More information about the Python-list mailing list