[Solved] Pickle user inputs – Python 3 [closed]
The following runs well. Rename your Player class with an uppercase initial to avoid name conflicts. I added some test calls at the end, and the player is loaded with the intended (not default) stats. import pickle class Player: def __init__(self, hp, dmg): self.hp = hp self.dmg = dmg def save(obj): save_file = open(‘save.dat’, ‘wb’) … Read more