I'm trying to create a txt file each time someone loses in the game (to save their score)
I succeeded and I now have a list of number which I want to sort, biggest first. Then I will use the 5 first lines each time it will be refreshed.
My txt file (for example):
10
1
5
4
3
2
What I want:
10
5
4
3
2
1
Thanks
#Saving the score    
Scorefile = open('Scoreboard.txt','a')    
Scorefile.write(str(score))    
Scorefile.write('\n')    
Scorefile.close()    
#Sorting the file   
Scorefile = open('Scoreboard.txt','a')
 
     
    