I'm making a text game and im making a save() and load() function i'v got the save function to work but i dont know how to change varyables in the program depending on the varyables in the text files.
heres the code for the functions:
def save():
openfile = open('save_file', 'r+')
openfile.seek(0, 0)
openfile.write(player.exp, '/n', player.level, '/n', player.health, '/n', new_monster.health, '/n', new_monster, '/n', new_monster.name, )
def load():
openfile = open('save_file', 'r')
openfile.read << this is where im stuck
any help would be apreciated