Re: sorting list of tuples by second (third...) tuple item

2007-02-16 Thread Bruno Desthuilliers
Giovanni Toffoli a écrit : > Hi, > > I'm not in the mailing list. > By Googling, I stepped into this an old post: (Thu Feb 14 20:40:08 CET > 2002) of Jeff Shannon: > http://mail.python.org/pipermail/python-list/2002-February/128438.html > > <<< > def SortOnItem(mylist, index): >templist = [

sorting list of tuples by second (third...) tuple item

2007-02-16 Thread Giovanni Toffoli
Hi, I'm not in the mailing list. By Googling, I stepped into this an old post: (Thu Feb 14 20:40:08 CET 2002) of Jeff Shannon: http://mail.python.org/pipermail/python-list/2002-February/128438.html <<< def SortOnItem(mylist, index): templist = [ (line[index], line) for line in mylist ] t