DAT file compilation

Nick Vatamaniuc vatamane at gmail.com
Fri Sep 29 22:32:19 EDT 2006


You can always use pickle. Have a script that reads your folder with
the media, insert the images and sounds into arrays or your own special
classes then use pickle to dump them to a .dat file. The user gets just
one .dat file.

When your program runs, it reads the object with the data from the
disk, no need to translate from a special data format, instantiate
objects, fill those objects with data and so on, because your "frozen"
Python objects are good to be used as soon as they are loaded.  Note:
this might speed up things a little during initialization of your
program.

Also, you can use cPickle for a much faster pickle (but check out the
constraints imposed by cPickle in the Python documentation).

Hope this helps,
-Nick Vatamaniuc



Jay wrote:
> Is there a way through python that I can take a few graphics and/or
> sounds and combine them into a single .dat file?  If so, how?  And how
> can I access the data in the .dat file from inside the python script?




More information about the Python-list mailing list