best Pythonic way to do this sort: Python newb

Sean Berry sean at buildingonline.com
Mon Oct 10 06:11:56 CEST 2005


Hello all

I have build a list that contains data in the form below
-- simplified for question --
myList = [[value1, value2, value3],[value1, value2, value3], ...]

I have a function which takes value3 from the lists above and returns
another value.  I want to use this returned value to sort the lists.

So, my resultant list would be ordered by the return value of the
function with value3 as its argument.

>From a relative Python newb, what is the best way to do this?

Thanks for any help offered. 





More information about the Python-list mailing list