I have a game I am writing in pygame and have map files. These are automatically generated by my game and I would like to compress/ decompress them before reading and writing to them so that my game goes quicker. The files are about 3 KB so they aren’t that big. Please help and thanks in advance.
Share
For the how: http://docs.python.org/library/archiving.html
For the which, that depends. In fact, I’m not even sure that compression will help you out here. But consider that gzip or bz2 might be a good choice if you want to compress individual files. However, if you want to compress/decompress all of your map files together, then you’ll want to consider a format that supports that, such as zipfile.