diff -rN 4508example/readme.txt empty/readme.txt 1,18d0 < I tested building this module under windows 2000 with python 2.6 and with python 2.5 < both in normal windows location c:/pythonXX and also tested with python2.5 < installed under C:/Program Files/Python. < < Command to build extension: < < python setup.py build_ext -c mingw32 --inplace < < < Then from python can use with < >>> import example < >>> example.gcd < < < For linux its even easier: < python setup.py build_ext --inplace < < then move the _example.so file from build into the current dir... diff -rN 4508example/without_space/example.c empty/without_space/example.c 1,19d0 < /* File : example.c */ < < /* A global variable */ < double Foo = 3.0; < < /* Compute the greatest common divisor of positive integers */ < int gcd(int x, int y) { < int g; < g = y; < while (x > 0) < { < g = x; < x = y % x; < y = g; < } < return g; < } < < diff -rN 4508example/without_space/example.i empty/without_space/example.i 1,7d0 < /* File : example.i */ < %module example < < %inline %{ < extern int gcd(int x, int y); < extern double Foo; < %} diff -rN 4508example/without_space/setup.py empty/without_space/setup.py 1,18d0 < # setup.py for compiling a python extension with swig... < import distutils < from distutils.core import setup, Extension < < setup( < name = "Example C Extension wrapped up all nice for python", < author = 'Brian Thorne', < author_email = 'hardbyte+python@gmail.com', < license='GPL v3 :: GNU General Public License', < version = "0.1", < ext_modules = [ < Extension( < "_example", < ["example.i","example.c"] < ) < ] < ) < diff -rN 4508example/with space/ex ample.c empty/with space/ex ample.c 1,19d0 < /* File : example.c */ < < /* A global variable */ < double Foo = 3.0; < < /* Compute the greatest common divisor of positive integers */ < int gcd(int x, int y) { < int g; < g = y; < while (x > 0) < { < g = x; < x = y % x; < y = g; < } < return g; < } < < diff -rN 4508example/with space/example.i empty/with space/example.i 1,7d0 < /* File : example.i */ < %module example < < %inline %{ < extern int gcd(int x, int y); < extern double Foo; < %} diff -rN 4508example/with space/setup.py empty/with space/setup.py 1,18d0 < # setup.py for compiling a python extension with swig... < import distutils < from distutils.core import setup, Extension < < setup( < name = "Example C Extension wrapped up all nice for python", < author = 'Brian Thorne', < author_email = 'hardbyte+python@gmail.com', < license='GPL v3 :: GNU General Public License', < version = "0.1", < ext_modules = [ < Extension( < "_example", < ["example.i","ex ample.c"] < ) < ] < ) <