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

Ethan Furman ethan at stoneleaf.us
Fri Mar 10 04:53:14 EST 2017


On 03/10/2017 12:43 AM, Chris Green wrote:
> Erik <python at lucidity.plus.com> wrote:
>> 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
>>
> OK.  :-)
>
> However how else can one describe an order which isn't 'sorted'? ...
> other than as the order one wants?

I want the order to be the same as the order I enter them in.  ;)

--
~Ethan~





More information about the Python-list mailing list