title: sorting a list in python based on difference from a value
body: <p>Anyone knows how to sort a list using a value as a reference?. For example I have the following list:</p>
  
  <pre><code>1,3,5,10,12
  </code></pre>
  
  <p>and the single value <code>7</code>, the output would be:</p>
  
  <pre><code>5,10,3,12,1
  </code></pre>
  
  <p>thanks!</p>