# cat blog >> /dev/brain 2> /proc/mind
cat blog >> /dev/brain 2> /proc/mind
# cat mission_02.py tree = { '01': '0', '0010': '1', '0001': '2', '00110': '3', '10': '4', '000000': '5', '00000100': '6', '00000101': '7', '00000110': '8', '00000111': '9', '00001': 'a', '001110': 'b', '001111': 'c', '111': 'd', '1101': 'e', '1100': 'f' } code = '' hexencoded = '' with open('huffman.code') as f: bd = f.read()[:-1] for d in bd: code += d if code in tree: hexencoded += tree[code] code = '' print hexencoded print hexencoded.decode('hex') # python mission_02.py 49204c696b652054726565732e20466c6f7765727320746f6f2e I Like Trees. Flowers too.
cat mission_02.py
python mission_02.py
Post a Comment
No comments:
Post a Comment