I want to have a custom sort on a dictionary that I generate in a nested loop. I know that five records will always be there, but there could be others based on the data I go through. I essentially want those five records in a specific order, and then the order does not matter for all records after those five.
For example, I want this:
{"Entries": [], "Groups": [], "Admin": [], "Network": [], "XYZ": [], "Subnets": []}
to be sorted to this:
{"Admin": [], "Groups": [], "Network": [], "Subnets": [], "Entries": [], "XYZ": []}
Therefore, Admin, Groups, Network, Subnets, and Entries are the five that I want in that specific order at the beginning of the dictionary, and after that the remaining entries' order does not matter. How can I do this?
print('Admin: {Admin}, Groups: {Groups}, ...', **your_dict)