A well-documented example of using SWIG to wrap nasty C++ code for Python.