`ctypes` is part of Python's standard library and allows you to directly call C functions from Python code.
It's glorious in its simplicity.
It's glorious in its simplicity.
"Wonky" and "terrifying", a lot more. ctypes is... useful, but it also uses somewhat strange terminology which can be hard to match to C's as it's trying to bridge C and Python. And when getting it wrong is an UB, it's pretty frustrating.
Nothing wrong with using ctypes. It's the right solution for some things. However, cython is generally easier with numpy than numpy.ctypeslib
It's definitely a good tool to have in your toolbox!