I have a script in which I have some functions in C ++ classes and I want to be able to use them with a python script. Let them say that I have a function
void greet(_msg); std::cout >> _msg >> std::endl;
I want to be able to call it through a custom Python call and pass arguments to it, for example using
saySomething("Hello")
As a .py file, I want it to call the greet function and pass "Hello" as an argument.
I know this is a topic that has been discussed in detail, and I did some research on implementing python in C ++, I managed to read the values ββfrom a python script using the standard Python / C API and run the function in Python from C ++ and pass her argument, but I canβt understand how to achieve this specific result.
I looked at ctypes and various wrapper libraries such as boost: python or swig, but I cannot understand to what extent they can help me achieve what I want.
leoncvlt
source share