Basically, I want to make Python call functions written in C.
So (as far as I know) my options are:
- CTypes / CFFI
- Create a DLL / SO / DyLib containing the C functions and access them using CTypes or CFFI . CFFI seems to be faster with the only drawback of declaring all function signatures in python.
- Pros:
- No need to adapt to my C functions. All type-translations are done in Python.
- Minuses:
- Python binary module
- Write Python interface to C, convert my C module to python binary module
- Pros:
- Minuses:
- All type conversions are performed in C. Using [SIP] [3], this can be automated.
Is converting a C module to a python binary module faster?
Are both solutions for sending python callbacks to C functions supported?
Is SIP a good option for creating a python interface? Are there any other options?
Are there any other features in any of them?
source share