protect resources (images) within a pygame-program
jerf at jerf.org
Thu Oct 21 21:23:39 CEST 2004
On Thu, 21 Oct 2004 11:43:23 -0700, benjamin wrote:
> I wander whether there is any possibility to compile a bunch of
> resources for a program, like images and soundfiles into a package
> like, let´s say "game.dat", so they do´t fly around in the programs
Valid; I'd suggest zipping them up and using the "zipfile" module,
standard w/ Python 2.3.
> und can be edited by everyone.
It is unclear to me whether you *want* them editable, or if you don't.
(Does the "not" in "do't" [sic] apply to just the first clause, or both?)
If you *want* them editable, zip files are great because they are
reasonably standard, and you can just unzip them, make the changes, and
zip them up. For extra bonus points, have your program look for the
unzipped resources *first*, then look in the zip file. That way, you can
just unzip and make the changes, zipping only for final distribution.
If you *don't* want them editable, that's impossible. All local resources
can always be edited. Even the "big guys" haven't solved that problem.
More information about the Python-list