Huffman Encoder written in python