I already had gcc and related stuff, so that might be a dependency.
after creating example.(i|c|h), I ran the following:
sudo apt-get install swig swig -python example.i
Then created setup.py and ran that:
python setup.py build_ext --inplace
and then could import:
>>> import example >>> example.fact(4) 24