I am trying to find a way to test my C code using python scripts. So far my findings are
1) with Ctypes, I can easily load the so and call the function directly from python. Plus, everything happens at run-time, so no extra compiling/wrapping stuff.
2) However, re-writing every types in python is tedious and error prone, especially for complex data types. And whenever the definitions change, I will have to update the definition in python scripts.
I am wondering since Swig can export datatypes automatically, is it possible to mix Swig and Ctypes together? i.e. use Swig to export datatypes, which can be used to call functions through  Ctypes.
p.s I am not sure whether Cython suits better, but we don't have Cython in the environment.
I ended up using Swig with dynamic linking to the so library generated by the C code. In this way, I only have to include the header files in the swig interface file to tell swig what functions/datatypes to expose. Another advantage of this approach is that I can write testing helper functions in C and easily expose those as well.
Python & C: Is it possible to mix Ctypes and Swig together?