Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from disktext_lookup import lookup
- f = open("../game/DISKTEXT.TXT", "rb")
- lines = f.read()
- f.close()
- #remove the carriage return (\r) at the beginning of the file
- lines = lines[1:]
- #split by line delimiter (carriage return, null, carriage return)
- lines = lines.split("\x00")
- print "%d lines" % len(lines)
- texts = []
- for line in lines:
- text = []
- for byte in line:
- text.append(lookup.get(ord(byte), byte))
- texts.append("".join(text))
- f = open("disktext_unpacked.txt", "wb") #disktext_unpacked.txt
- f.write("\x00".join(texts))
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment