I've got solver.py which has solver: tuple -> tuple function.
My usage of python in C++ looks like this:
Py_Initialize();
PyObject *name, *load_module, *func, *callfunc, *args;
name = PyUnicode_FromString((char*)"solver");
load_module = PyImport_Import(name);
func = PyObject_GetAttrString(load_module, (char*)"solver");
args = PyTuple_Pack(4,
PyFloat_FromDouble(var1),
PyFloat_FromDouble(var2),
PyFloat_FromDouble(var3),
PyFloat_FromDouble(var4)
);
callfunc = PyObject_CallObject(func, args);
vector<double> solver_out = ???(callfunc);
Py_Finalize();
I have a problem in getting a tuple from callfunc, i can't find the appropriate function which would convert the result of PyObject_CallObject to c++ vector. As I said before, python func returns tuple.
I'll be grateful for any help!
I've tried to find smth like "PyObject_AsTuple(callfunc)" but all didn't work.