[220.127.116.11/dictionary] Change sorting order?
neilc at norwich.edu
Fri Jan 22 14:35:26 CET 2010
On 2010-01-22, Gilles Ganault <nospam at nospam.com> wrote:
> I use a dictionary to keep a list of users connected to a web
> 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.
Resorting is more work than is needed. Just choose a different
starting index each time you display the names, and set up your
lister to wrap-around to your arbitrary starting index.
More information about the Python-list