The following examples illustrate the use of SWIG with Python.
% swig -python interface.i
% swig -python interface.i % gcc -fpic -c interface_wrap.c -I/usr/local/include/python1.5 % gcc -shared interface_wrap.o $(OBJS) -o interfacemodule.so % python Python 1.5.2 (#3, Oct 9 1999, 22:09:34) [GCC 2.95.1 19990816 (release)] on linux2 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import interface >>> interface.blah(...) ...
*shared* interface interface_wrap.c $(SRCS)
% make -f Makefile.pre.in boot % make
Your mileage may vary. If you experience a problem, please let us know by contacting us on the mailing lists.