Hello
In my program I have a text file that I read from and write to. However, I would like to display the contents of the text file in an alligned and sorted manner. The contents currently read-
name, score
name, score
Would I have to convert this information into lists in order to be able to do this? If so, how do I go about doing this?
This is the code where the contents of the text file is read and printed-
elif userCommand == 'V':
print "High Scores:"
scoresFile = open("scores1.txt", 'r')
scores = scoresFile.read().split("\n")
for score in scores:
print score
scoresFile.close()
Thankyou