Created
July 8, 2013 02:34
-
-
Save jedy/5945865 to your computer and use it in GitHub Desktop.
convert pvr to pvr.ccz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zlib | |
import struct | |
import sys | |
pvr = sys.argv[1] | |
ccz = pvr + ".ccz" | |
pvr = open(pvr).read() | |
ccz = open(ccz, "wb") | |
ccz.write(struct.pack(">4sHHII", "CCZ!", 0, 1, 0, len(pvr))) | |
ccz.write(zlib.compress(pvr)) | |
ccz.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
第8行改成pvr=open(pvr, "rb").read() 后能正常工作。