Is there a Python library that packs binary data into one file?

Mike C. Fletcher mcfletch at rogers.com
Mon Apr 26 18:44:51 EDT 2004


Jacob H wrote:

>Hello all,
>
>Today I began writing a utility script that takes given binary files
>and puts them all into one datafile. My idea is to be able to access
>any binary data I want by indexing the datafile, e.g.
>wanted_image_data = datafileobj[IMAGE_DATA]. The purpose is to hide
>external image files from the user in a simple game I'm writing.
>
>Though I have a good idea of how to implement this, before I begin I
>am curious to know if some Python master out there has already come
>out with a library that does the same. Anyone? :)
>  
>
Not quite what you're asking for, but ResourcePackage embeds resources 
automatically in Python files.  If you are py2exe'ing your projects the 
result is that the images are invisible (they are part of the Python 
bytecode files py2exe packs into the exe).  The nice part is the 
automation; you just update the data-file (stored in a sub-package of 
your main game package) and the embedded version is automagically 
updated on next import of the resource package (run of the game).

http://resourcepackage.sf.net/

Have fun,
Mike

_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/






More information about the Python-list mailing list