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