title: Create a file in python
body: <p>Now i know how to implement a dictionary by file txt.
  So i have create the example.txt (generic file) :</p>
  
  <pre><code>aaa.12
  bbb.14
  ccc.10
  </code></pre>
  
  <p>and to make a dictionary:</p>
  
  <pre><code>with open('example.text') as f:
      hash = {}
      for line in f:
          key, value = line.strip().split('.', 1)
          hash[key] = int(value)
  </code></pre>
  
  <p>So now i want to order my elemen by value: so i try</p>
  
  <pre><code>with open('example.txt') as f:
      hash = {}
      for line in f:
          key, value = line.strip().split('.', 1)
          hash[key] = int(value)
          print hash #this print my dict
          value_sort=sorted(hash.values())
          print value:sort #to check the what return and gave me in this case value_sort=[10, 12, 14]
  </code></pre>
  
  <p>perfect so now how can i write on example.txt my items order by value:</p>
  
  <pre><code>ccc.10
  aaa.12
  bbb.14
  </code></pre>