Readline and record separator

George Sakkis george.sakkis at gmail.com
Tue Oct 30 09:21:20 EDT 2007


On Oct 30, 8:21 am, Johny <pyt... at hope.cz> 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 does NOT read the whole my record.
> So If I could change '\n' as  a record separator for readline, it
> would solve my problem.
> Any idea?
> Thank you
> L.

Check out this recipe, it's pretty generic:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/521877.

George




More information about the Python-list mailing list