gcc -Wall -fPIC -c -lm xxx.c gcc -shared -o xxx.so xxx.o from ctypes import cdll ib = cdll.LoadLibrary("./xxx.so")