Embedding python + numpy code into C++ dll callback
问题 I am new of python embedding. I am trying to embed python + numpy code inside a C++ callback function (inside a dll) the problem i am facing is the following. if i have: Py_Initialize(); // some python glue // python invocation Py_Finalize(); everything works fine. but if i have: Py_Initialize(); _import_array(); //to initialize numpy C-API // some python glue + numpy array object creation // python invocation via PyObject_CallObject() Py_Finalize(); this crashes at the second time it reaches