[Tutor] .readlines() condensing multiple lines

Kent Johnson kent37 at tds.net
Wed Mar 23 06:12:12 CET 2005


Liam Clarke wrote:
> Worse come to worse, you could always do - 
> x = file(myFile, 'r').read()
> listX = x.split('\r')

This will leave the \n in the strings. Reading with universal newlines is a better solution.

Kent



More information about the Tutor mailing list