Created
November 11, 2017 04:40
-
-
Save jogardi/71297ce77e8d8e0bf59178cc569af59e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import os.path | |
def save_scores(scores): | |
with open('scores.csv', 'w+') as f: | |
for score in scores: | |
f.write(str(score) +"\n") | |
def load_scores_from_file(): | |
with open('scores.csv', 'r') as f: | |
reader = csv.reader(f) | |
scores = [] | |
for line in reader: | |
print(line[0]) | |
scores.append(line[0]) | |
return scores |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment