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

Erik python at lucidity.plus.com
Thu Mar 9 17:30:01 EST 2017


On 09/03/17 13:09, Chris Green wrote:
> Michael Torrie <torriem at gmail.com> wrote:
>> On 03/08/2017 12:27 PM, Chris Green wrote:
>>> I have a fairly simple application that populates a GUI window with
>>> fields from a database table.  The fields are defined/configured by a
>>> dictionary as follows:-
>>
>> Instead of ordering the data in Python, why not rely on the GUI to do
>> the sort?  Most GUI's even have table widgets that let you click on the
>> headings to sort arbitrarily.
>>
> How would it sort it?  The order I want is arbitrary, or at least not
> alphabetical or anything, I just want the order to be the way I
> listed it.

To be fair to Michael, you did not state your required order in the 
message that he replied to. You just kept saying "the order I want".

If you're going to make people guess, don't chastise them for guessing 
wrong :D

E.



More information about the Python-list mailing list