Equivalent of Perl chomp?
Thomas Bellman
bellman at lysator.liu.se
Sat Feb 2 11:20:19 EST 2002
More information about the Python-list mailing list
Sat Feb 2 11:20:19 EST 2002
- Previous message (by thread): Equivalent of Perl chomp?
- Next message (by thread): Equivalent of Perl chomp?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Steve Holden" <sholden at holdenweb.com> wrote: > Perhaps I'm just lazy, but why not process > for line in file(filename).read().split("\n"): > under such circumstances? Because a) I don't like reading entire files into memory before processing, when not needed. I'm not very fond of wasting memory. Too many programs do that already, and I don't feel the need to contribute to that. b) It is more complicated to read and understand. 'for line in fp.xreadlines()' is immediately understandable, while your variant takes a couple of seconds to understand the full implications of. -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden "Don't tell me I'm burning the candle at both ! bellman @ lysator.liu.se ends -- tell me where to get more wax!!" ! Make Love -- Nicht Wahr!
- Previous message (by thread): Equivalent of Perl chomp?
- Next message (by thread): Equivalent of Perl chomp?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list