Newby: how to transform text into lines of text

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Mon Jan 26 17:12:43 EST 2009


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)``.  :-)

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list