Want to meet any of these people? They are registered for PyCon

Stephen Thorne stephen.thorne at gmail.com
Mon Jan 31 18:24:57 EST 2005


On Mon, 31 Jan 2005 17:49:53 -0500, Steve Holden <steve at holdenweb.com> wrote:
> Aahz wrote:
> > In article <ntrLd.101049$Jk5.19243 at lakeread01>,
> > Steve Holden  <steve at holdenweb.com> wrote:
> >
> >>Note that the sort order isn't perfect - I just sorted on the second
> >>"word" in each name. PyCon is a *great* place to meet people and discuss
> >>ideas. Hope to see you there.
> >
> >
> > Good thing I'm not coming this year, eh?  ;-)
> 
> If you mean specifically for sorting purposes, it would have put the
> null second name at the beginning just like you'd expect.

Odd, the naive way I would have written such a script would have been:

all_names = (line.split() for line in sys.stdin)
sys.stdout.writelines(' '.join(x[1])+'\n' for x in sorted((name[1],
name) for name in all_names))

which would not have worked correctly, it would have thrown an
exception because "Aahz\n".split()[1] does not exist.

I guess the second iteration would use name[1:] instead...

unfortunately-not-going-to-pycon-ly y'rs.
Stephen Thorne



More information about the Python-list mailing list