[Tutor] .readlines() condensing multiple lines

Liam Clarke cyresse at gmail.com
Wed Mar 23 06:19:37 CET 2005


Oh right, From his email, I got the impression he was getting a list like - 
[[abc\rdef\rghi\r]]




On Wed, 23 Mar 2005 00:12:12 -0500, Kent Johnson <kent37 at tds.net> wrote:
> 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
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 


-- 
'There is only one basic human right, and that is to do as you damn well please.
And with it comes the only basic human duty, to take the consequences.


More information about the Tutor mailing list