title: Custom sort on a dictionary in Python?
body: <p>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.</p>
  
  <p>For example, I want this:</p>
  
  <pre><code>{"Entries": [], "Groups": [], "Admin": [], "Network": [], "XYZ": [], "Subnets": []}
  </code></pre>
  
  <p>to be sorted to this:</p>
  
  <pre><code>{"Admin": [], "Groups": [], "Network": [], "Subnets": [], "Entries": [], "XYZ": []}
  </code></pre>
  
  <p>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?</p>