Specify the sorting direction for the various columns/

Mark Tolonen metolone+gmane at gmail.com
Fri Jun 12 00:55:16 EDT 2009


"Oni" <drentha at gmail.com> wrote in message 
news:018f4fa2-7203-4c98-a313-da5584976bd9 at z20g2000prh.googlegroups.com...
> Managed to get a dictionary to sort on multiple columns using a tuple
> to set the sort order (see below). However how can I control that
> column "date" orders descending and the column "name" orders
> ascending.

One way is to sort twice...sort on the secondary key first, then the primary 
key.  sort will maintain the order of equal entries.

-Mark





More information about the Python-list mailing list