Hi, I am developing an application where I have Python embedded in C functions using the C/Python API to execute commands. My question stems from my need to preserve a PyObject to pass between these Python embedded C functions. My question is: do I have to call Py_Finalize() at the end of each Python embedded C function? The abstract structure of my code looks like this: PyObject *po; main() { po = py_function_1(); // some C code in the middle here... po = py_function_2(po); // some more C code here... } In my implementation of py_function_1 and py_function_2 do I have to call Py_Initialize() and Py_Finalize at the beginning and end of each of the two functions? Or can I just call Py_Initialize at the beginning of py_function_1 and then call Py_Finalize() at the end of py_function_2? Thank You. SP
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4