>From http://wiki.python.org/moin/HowTo/Sorting#Sortingbykeys, using the >Decorate-Sort-Undecorate (aka Schwartzian transform) idiom:
#!/usr/bin/env python items = ['apple', 'car', 'town', 'phone'] values = [5, 2, 7, 1] zipped=zip(values,items) zipped.sort(reverse=True) values_sorted,items_sorted=zip(*zipped) print values_sorted # (7, 5, 2, 1) print items_sorted # ('town', 'apple', 'car', 'phone') -- http://mail.python.org/mailman/listinfo/python-list