help with huffman code
<p>ok I have my huffman class which seem to be working fine. however when I am trying to make my binary tree I keep on getting an error message saying that ''the global name encoding is not defined'' when the name of my function is encoding. Can someone please tell me why? below is my code. Thank you</p>

<pre><code>def get_encoding(self):
        # Huff is a previously defined function that generates the tree 
        node=self.Huff()
        dic={}
        if node.char:
            if not self:
                dic[node.char]='0'
            else:
                dic[node.char]=self
        else:
               encoding(self+'0',node.left)
               encoding(self+'1',node.right)
</code></pre>
