title: Highscores using python / Saving 10 highscores and ordering them
body: <p>I am making a game on python and tkinter, and I would like to save the highscores of the game. I have an entry which takes the name of the player and assign it to a global (Name1) and a global (Score1) in which the score is saved.</p>
  <p>The thing is that I need a file that stores the best 10 highscores, obviously showing them from the biggest score to the lowest.</p>
  <p>My question is: How do I make that?</p>
  <p>How can I save the Name and the Score to the file?
  How can I save the scores with an order? (Including the name associated to the score)</p>
  <p>I am really confused using the methods of .readline() and .write() and .seek() and all of those.</p>
  <p>EDIT:</p>
  <p>I need something like this:</p>
  <p>The globals are Name1, Which lets say is &quot;John&quot; And Score1, Which at the end of the game will have an int object.</p>
  <p>So after a few games, John achieved 3000 on the score, and then 3500, and then 2000.</p>
  <p>The highscores file should look like:</p>
  <pre><code>John 3500
  John 3000
  John 2000
  </code></pre>
  <p>And if Mike comes out and play and achieve a 3200 score, the file should look like this:</p>
  <pre><code>John 3500
  Mike 3200
  John 3000
  John 2000
  </code></pre>
  <p>The max amount of players on the highscore must be ten. So if there are already ten Highscores saved, and a bigger one comes out, the lowest score must be although ignored or deleted. (I need the file because I need to do the display on a Tkinter window)</p>
  <p>PD: Excuse my weird English! Thank you!</p>