[Tutor] Iterable Understanding

Stephen Nelson-Smith sanelson at gmail.com
Sat Nov 14 14:34:09 CET 2009


Hi,

>> for log in logs:
>>  l = log.getline()
>>  print l
>>
>> This gives me three loglines.  How do I get more?  Other than while True:
>>
> I presume that what you want is to get all lines from each log.

Well... what I want to do is create a single, sorted list by merging a
number of other sorted lists.

> for log in logs:
>     for line in log.getlines():
>         print l

This gives me three lines.

S.


More information about the Tutor mailing list