Re: Readline and record separator

2007-11-02 Thread Bruno Desthuilliers
Dennis Lee Bieber a écrit : > On Wed, 31 Oct 2007 11:13:21 +0100, Bruno Desthuilliers > <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > >> [1] Coma Separated Values - but the separator can be almost anything. >> > Comma... oops... > though at this time of night I feel

Re: Readline and record separator

2007-10-31 Thread Bruno Desthuilliers
Johny a écrit : > On Oct 30, 8:44 pm, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: >> Johny a écrit : >> >>> Is it possible to change record separator when using readline? >>> As far as I know readline reads characters until found '\n' and it is >>> the end of record for readline. >> This is no

Re: Readline and record separator

2007-10-31 Thread Johny
On Oct 30, 8:44 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Johny a écrit : > > > Is it possible to change record separator when using readline? > > As far as I know readline reads characters until found '\n' and it is > > the end of record for readline. > > This is not a "record" separato

Re: Readline and record separator

2007-10-30 Thread Bruno Desthuilliers
Jeff a écrit : > If it's a short file you could slurp the entire file and then split it > however you like using regular expressions. My my my... > I'm not sure if you can alter it, You can. But it hopefully won't alter your binary-compiled system libs. IOW : it's so (obviously) useless that no

Re: Readline and record separator

2007-10-30 Thread Bruno Desthuilliers
Johny a écrit : > Is it possible to change record separator when using readline? > As far as I know readline reads characters until found '\n' and it is > the end of record for readline. This is not a "record" separator, but a newline. As the name implies, file.readline is about reading a text fi

Re: Readline and record separator

2007-10-30 Thread BartlebyScrivener
On Oct 30, 7:21 am, Johny <[EMAIL PROTECTED]> wrote: > My problem is that my record consits several '\n' and when I use > readline it does NOT read the whole my record. > So If I could change '\n' as a record separator for readline, it > would solve my problem. Python Cookbook (great book!) 2nd E

Re: Readline and record separator

2007-10-30 Thread George Sakkis
On Oct 30, 8:21 am, Johny <[EMAIL PROTECTED]> wrote: > Is it possible to change record separator when using readline? > As far as I know readline reads characters until found '\n' and it is > the end of record for readline. > My problem is that my record consits several '\n' and when I use > readli

Re: Readline and record separator

2007-10-30 Thread clbr
On Oct 30, 12:21 pm, Johny <[EMAIL PROTECTED]> wrote: > Is it possible to change record separator when using readline? > As far as I know readline reads characters until found '\n' and it is > the end of record for readline. > My problem is that my record consits several '\n' and when I use > readl

Re: Readline and record separator

2007-10-30 Thread A.T.Hofkamp
On 2007-10-30, Johny <[EMAIL PROTECTED]> wrote: > Is it possible to change record separator when using readline? > As far as I know readline reads characters until found '\n' and it is > the end of record for readline. > My problem is that my record consits several '\n' and when I use > readline it

Re: Readline and record separator

2007-10-30 Thread Jeff
If it's a short file you could slurp the entire file and then split it however you like using regular expressions. I'm not sure if you can alter it, but os.linesp holds the value that is accessed when file.readlines() splits lines. Conceivably, if it were set to 'FOO', 'FOO' would be used to dete

Readline and record separator

2007-10-30 Thread Johny
Is it possible to change record separator when using readline? As far as I know readline reads characters until found '\n' and it is the end of record for readline. My problem is that my record consits several '\n' and when I use readline it does NOT read the whole my record. So If I could change '