[issue1152248] Enhance file.readlines by making line separator selectable

2010-07-22 Thread Douglas Alan
Douglas Alan added the comment: Personally, I think that this functionality should be built into Python's readlines. That's where a typical person would expect it to be, and this is something that is supported by most other scripting language I've used. E.g., awk has the RS

[issue1152248] Enhance file.readlines by making line separator selectable

2010-07-02 Thread Douglas Alan
Douglas Alan added the comment: Until this feature gets built into Python, you can use a Python-coded generator such as this one to accomplish the same effect: def fileLineIter(inputFile, inputNewline="\n", outputNewline=None, rea

[issue1152248] Enhance file.readlines by making line separator selectable

2009-05-15 Thread Douglas Alan
Douglas Alan added the comment: Antoine Pitrou wrote: > Nick Coghlan added the comment: > > Note that the problem with the read()+split() approach is that you > > either have to read the whole file into memory (which this RFE is trying > > to avoid) or you have to do y