Apr-05-2019, 10:43 AM
Sorting dictionaries is usually making little sense. However, starting from Python 3.7 dictionaries are guaranteed to be in insertion order. So - if you want 'sorted dictionary' then you should build new dictionary by inserting key-value pairs in sorted order.
Still, it seems to me that you actually not wanting to sort dictionary. It seems to me that you actually want sort list (of dictionaries). Meaning that list elements (which happens to be nested dictionaries) must be ordered based on some value in nested dictionary. Is it so? Do you want sort list of dictionaries based on value on first row 'Num_Subdir': 11 in nested dictionary?
Still, it seems to me that you actually not wanting to sort dictionary. It seems to me that you actually want sort list (of dictionaries). Meaning that list elements (which happens to be nested dictionaries) must be ordered based on some value in nested dictionary. Is it so? Do you want sort list of dictionaries based on value on first row 'Num_Subdir': 11 in nested dictionary?
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.