On Tue, Nov 10, 2009 at 11:25 AM, Stephen Nelson-Smith
<sanel...@gmail.com> wrote:

> So what I want to do is be able to multiplex the files - ie read the
> next line of all 12 files at once, filter them accordingly, and then
> write them out to one combined file.
>
> My old code did this;
>
> min((x.stamp, x) for x in logs)
>
> What's the best way to do this now I'm using an iterable LogFile class?

See the Python Cookbook recipes I referenced earlier.
http://code.activestate.com/recipes/491285/
http://code.activestate.com/recipes/535160/

Note they won't fix up the jumbled ordering of your files but I don't
think they will break from it either...

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to