I have a bunch of functions written in python (for quick prototyping). My main project is in C ++, and I want to call these functions my C ++ program.
These functions use some specialized python modules such as numpy, pyside, etc.
I tried using the "-embed" Cython functions to convert these functions to a C file and then compile them into an object file. The only problem is that Cython converts these functions to standalone programs, i.e. makes the main () function in the .c files that it creates. I do not want this, I just want to call them from my C ++ program and use the results.
Are there any other alternatives that I could use to achieve this (Python / C API, SWIG, etc.)? Or am I using cython to improperly embed python?
I am using Python3 and Cython 0.22.1.
source share