Few suggestions for your code: - Use xrange instead of range. - Loop over lists where you can instead of their indexes. - array.array("B", somestring) may help you because it gives a byte "view" of a string. - Using psyco helps a lot for such kind of code. - I think numpy arrays can contain text/chars too, so it may offer you ways to speed up your code a lot. - Generally Python is fit to download pages from the net or to act as glue between different subsystems, or to do bulk string processing, etc, but for grunt low-level works like this it's often too much slow, and you can use other lower-level languages. - You can use a lib already written, or use an extension, for example you can try ShedSkin, or Pyd.
Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list