title: sort a dict type variable by value in python
body: <p>I have a dict type variable like <code>{'key1':6,'key2':1,'key3':5,'key4':44}</code> my dictionary contains millions of key:val pair
  I want to store it in txt file such that key corresponding to highest val comes first and so on in descending order
  eg my txt file will look like</p>
  
  <pre><code>key4: 44
  key1: 6
  key3: 5
  key2: 1
  </code></pre>