Newby: how to transform text into lines of text

Andreas Waldenburger geekmail at usenot.de
Mon Jan 26 17:38:14 EST 2009


On 26 Jan 2009 22:12:43 GMT Marc 'BlackJack' Rintsch <bj_666 at gmx.net>
wrote:

> On Mon, 26 Jan 2009 16:10:11 +0100, Andreas Waldenburger wrote:
> 
> > On 26 Jan 2009 14:51:33 GMT Marc 'BlackJack' Rintsch
> > <bj_666 at gmx.net> wrote:
> > 
> >> On Mon, 26 Jan 2009 12:22:18 +0000, Sion Arrowsmith wrote:
> >> 
> >> > content = a.readlines()
> >> > 
> >> > (Just because we can now write "for line in file" doesn't mean
> >> > that readlines() is *totally* redundant.)
> >> 
> >> But ``content = list(a)`` is shorter.  :-)
> >> 
> > But much less clear, wouldn't you say?
> 
> Okay, so let's make it clearer and even shorter: ``lines =
> list(a)``.  :-)
> 
OK, you win. :)

/W

-- 
My real email address is constructed by swapping the domain with the
recipient (local part).



More information about the Python-list mailing list