I would like to use pickle() to save the stats, progress, and location of a player in my text adventure. I know that pickle() write an object to a text file, and that file can be later recalled to load the information.
My curiosity is, would I be able to save the stats, inventory and last location of the player by pickling into one file? If so, how would I do this? I am not quite sure how to use pickle(), so if anyone has any spare source codes where they used pickle() which I could learn from it would be greatly appreciated. Also, would I have to create one object containing all of this information in order to pickle what I need?
And for refreshment, what is an object? I am going to go back through my tutorials to brush up on key terms and concepts, in the meantime. Thanks,
karim
mruane 0 Junior Poster in Training
Agni 370 Practically a Master Poster Featured Poster
lllllIllIlllI 178 Veteran Poster
mruane 0 Junior Poster in Training
Ene Uran 638 Posting Virtuoso
mruane 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.