If you want to use the huffman.py program, here are some options. 1) Use it directly in a shell a) Type ~mackay/python/compression/huffman/Huffman.py b) Type in a list of numbers, one per line 0.25 0.5 0.125 0.125 c) Then (on the next line) press CONTROL-d 2) Feed huffman.py with a list of numbers in a file. a) First make a list of numbers in a file. $ cat > myprobabilities 0.25 0.5 0.125 0.125 [Hit Control-d to stop writing to the file] [You can make this list of numbers in any way you want, using emacs, or a program, for example.] b) Use huffman.p thus: $ ~mackay/python/compression/huffman/Huffman.py < myprobabilities The program will immediately run (no need to press control-d). 3) For your convenience, you may also give names to the different outcomes. For example a) $ cat > myprobabilities 0.25 a 0.5 b 0.125 c 0.125 d b) $ ~mackay/python/compression/huffman/Huffman.py < myprobabilities The output from this example is: #Symbol Count Codeword a (0.25) 01 b (0.5) 1 c (0.12) 000 d (0.12) 001 4) You can also use this Huffman module from within another python program.