Calling C functions from Python – part 1 – using ctypes

Recently I’ve been evaluating Python interop technologies for a project at work and I think it’ll made an interesting blog series. Let’s say your have following C code (add extern “C” if you are in C++ land) and compile it into a dynamic library (dll/.so/.dylib): int Print(const char *msg) { printf(“%s”, msg); return 0; } int Add(int…

0