Re: Record separator for readlines()

2005-09-02 Thread Bengt Richter
On Fri, 2 Sep 2005 22:10:18 -0500, [EMAIL PROTECTED] wrote: > >--SkvwRMAIpAhPCcCJ >Content-Type: text/plain; charset=us-ascii >Content-Disposition: inline > >I think you still have to roll your own. > >Here's a start: > def ireadlines(f, s='\n', bs=4096): > if not s: raise ValueErr

Re: Record separator for readlines()

2005-09-02 Thread jepler
I think you still have to roll your own. Here's a start: def ireadlines(f, s='\n', bs=4096): if not s: raise ValueError, "separator must not be empty" r = [] while 1: b = f.read(bs) if not b: break ofs = 0

Re: Record separator for readlines()

2005-09-02 Thread gene tani
universal newlines? http://www.python.org/doc/2.3.3/whatsnew/node7.html Angelic Devil wrote: > I know this has been asked before (I already consulted the Google > Groups archive), but I have not seen a definative answer. Is there a > way to change the record separator in readlines()? The documen

Record separator for readlines()

2005-09-02 Thread Angelic Devil
I know this has been asked before (I already consulted the Google Groups archive), but I have not seen a definative answer. Is there a way to change the record separator in readlines()? The documentation does not mention any way to do this. I know way back in 1998, Guido said he would consider