What's the neatest way of getting dictionary entries in a specified order?

John Gordon gordon at panix.com
Mon Mar 13 14:04:56 EDT 2017


In <mailman.241.1489242093.2612.python-list at python.org> Michael Torrie <torriem at gmail.com> writes:

> The order of the displayed fields is usually something set by the GUI
> API when you create the table widget. At least in most toolkits I'm
> familiar with.  As well, when you add the row to the widget, you
> normally specify the fields (the data) individually, so I would think
> the order of the dict's fields does not matter since you'd manually
> specify each field's data.

The original example used a loop to get all of the dict fields and
add them to the GUI, instead of adding each field individually.

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"




More information about the Python-list mailing list