I have a bunch of python code that I would like to โcompileโ into a shared library with a C interface, which can be linked to other C / C ++ programs and work regardless of too many other libs (maybe python and some other dlls, but they should all be included in the directory with the final lib).
I really don't want to rewrite Python code in C ++ for this. I can, of course, but it would be better to have a standalone lib that can be used as dll / so lib.
I tried cython and wanted to compile python to C and then just compile the C code into dll, but that still doesn't work (I haven't been able to make it work flawlessly yet). And then I also tried bbfreeze - but does bbfreeze support creating a .so file? Could not figure out how to do this. Somebody knows?
Do you know any other options that are simpler? python code needs to be compiled only once. And it would be best if he created one .so file no matter how large it is, it just works without too many dependencies.
source share