python † C で書かれた関数を python から呼び出す C のソース /* hello.c */ int print_hello() { printf("hello\n"); return 0; } hello.i を作成 /* hello.i */ %module hello %{ /* Put header files here (optional) */ extern int print_hello(); %} extern int print_hello(); こうやる $ swig -python hello.i $ gcc -c hello.c hello_wrap.c -I/usr/include/python2.3 $ ld -shared hello.o hello_wrap.o -o _hello.so python $ python >>> import