pickle - Python - where to initialize a player inventory? -


i'm having bit of problem in python. it's not syntax or but, making text rpg. have save/load feature within game using pickle. works fine. problem when load game, inventory variable set defined in init of main class. this:

            class main():                 def __init__(self):                     self.inventory = [] 

and load command in main class well. reason when load variables pickle, resets inventory whatever set in main class. how can stop this?


Comments

Popular posts from this blog

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

node.js - Using Node without global install -

java - JavaScript + Thymeleaf - select onchange -