[prev in list] [next in list] [prev in thread] [next in thread]
List: python-list
Subject: Re: Want to meet any of these people? They are registered for PyCon
From: Steve Holden <steve () holdenweb ! com>
Date: 2005-01-31 23:25:59
Message-ID: jdzLd.101294$Jk5.61620 () lakeread01
[Download RAW message or body]
Stephen Thorne wrote:
> On Mon, 31 Jan 2005 17:49:53 -0500, Steve Holden <steve@holdenweb.com> wrote:
>
>>Aahz wrote:
>>
>>>In article <ntrLd.101049$Jk5.19243@lakeread01>,
>>>Steve Holden <steve@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
Sorry you can't make it to Python. My even-naiver way of approaching the
problem was to use the sort utility built into Cygwin, thereby avoiding
writing any code at all.
regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
--
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic