Skip to content

Instantly share code, notes, and snippets.

@jogardi
Created November 11, 2017 04:40
Show Gist options
  • Save jogardi/71297ce77e8d8e0bf59178cc569af59e to your computer and use it in GitHub Desktop.
Save jogardi/71297ce77e8d8e0bf59178cc569af59e to your computer and use it in GitHub Desktop.
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