I am exploring python. I curious about python bindings. Could anybody explain, how it is possible that you can have access to C libraries from Python.
Answer is simple, python (CPython) interpreter is written in C and it can call other C libraries dynamically, your C extension module or embedded C code can be easily called from any other C code.
CPython allows special hooks so that it can call other C code or can be called from other C code. It need not even be C, any language which compiles to native code and have same calling convention.
For a simple case consider you create a program called mython, which can load any shared library and tries to call a function run
e.g.
lib = dlopen("mylib.so", RTLD_LAZY);
func = dlsym(lib, "run");
(*func)();
So in way you have loaded a module and called its code, CPython does that but in more complex way, providing better interfaces and objects to pass around, plus there are other intricacies involved of memory management, thread management etc.
So platform of Python implementation must match to language in which it is being extended, e.g. CPython is not extensible in Java but Java implementation of Python called Jython can be extended in Java and similarly .NET implementation IronPython can be extended in .Net languages.