Re: Deserializing specific objects from a file
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 -- http://mail.python.org/mailman/listinfo/python-list
Re: Deserializing specific objects from a file
That's exactly what I needed. Thank you. Aaron J. M. -- http://mail.python.org/mailman/listinfo/python-list
Deserializing specific objects from a file
I'm building a game and am starting to seriously think about serialization, though I haven't done much serialization before except for a few experiments with the pickle module. 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? Thank you, Aaron J. M. P.S. Is it *deserialize* or *unserialize*? -- http://mail.python.org/mailman/listinfo/python-list