Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 19 lines (15 sloc) 0.625 kb
a39b9f9 First Commit
Andrew Patrick Dudash authored
1 "This file handles the actual file writing of saving the game. The messenger class handles the heavy lifting."
2 import json
3 from os.path import sep
4
5 def save_game(file_name, json_info):
6 "Take a name for the save file and the info required to save to save the game."
7 save_file = open("saves" + sep + file_name, "w")
8 json_info = json.dumps(json_info)
9 save_file.write(json_info)
10 save_file.close()
11
12 def load_game(file_name):
13 save_file = open("saves" + sep + file_name)
14 json_info = save_file.read()
15 json_info = json.loads(json_info)
16 save_file.close()
17 return json_info
18
Something went wrong with that request. Please try again.