En Mon, 17 Sep 2007 09:02:38 -0300, BlueBird <[EMAIL PROTECTED]>
escribi�:
> Oooops. It was a stupid bug in my script: textLine[:-
> int(textLine[-1]=='\n')] is not what I want (the real code was not a
> one-liner)! The documentation made me think that something wrong was
> going on with pyt
On 17 sep, 13:24, Steve Holden <[EMAIL PROTECTED]> wrote:
> BlueBird wrote:
> > I tried and failed to read text files where the last line does not
> > contain proper EOL. For my tests, I use a file that I create with the
> > equivalent of :
>
> > open('toto', 'w').write( '1234\n4567\n89AB' )
>
> >
BlueBird wrote:
> I tried and failed to read text files where the last line does not
> contain proper EOL. For my tests, I use a file that I create with the
> equivalent of :
>
> open('toto', 'w').write( '1234\n4567\n89AB' )
>
>
> My reading code looks like this :
>
>l = f.readline()
>
I tried and failed to read text files where the last line does not
contain proper EOL. For my tests, I use a file that I create with the
equivalent of :
open('toto', 'w').write( '1234\n4567\n89AB' )
My reading code looks like this :
l = f.readline()
while len(l):
self