Deserializing specific objects from a file
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Wed Sep 19 02:34:18 EDT 2007
On Tue, 18 Sep 2007 16:02:38 -0700, Aaron J. M. wrote:
> There are many objects that I want be able to move in and out of
> memory at runtime; namely the game levels. I only want one level in
> memory at a time, so I want to be able to unpickle specific Level
> objects as the player moves between levels. I would prefer my
> serialized objects to reside in one file.
>
> I haven't come across references that say how to do something like
> what I'm describing. Does anyone here know what techniques I have to
> employ here?
Take a look at the `shelve`-Module. Another option might be pickling to
individual files and store them in a ZIP archive.
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list