[2.5.1.1/dictionary] Change sorting order?

Gilles Ganault nospam at nospam.com
Fri Jan 22 07:17:44 EST 2010


Hello

I use a dictionary to keep a list of users connected to a web site.

To avoid users from creating login names that start with digits in
order to be listed at the top, I'd like to sort the list differently
every minute so that it'll start with the next letter, eg. display the
list from A...Zdigits the first time, then B...ZAdigits, etc.

That way, users have no incentive to create login names that start
with either a digit or letter A.

I see that dictionaries can be sorted using the... sort() method, but
is it possible to have Python start sorting from a different letter?

Thank you.



More information about the Python-list mailing list