Difference between Py_NewInterpreter() and Py_Initialize()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bulldog
    New Member
    • Jan 2007
    • 7

    #1

    Difference between Py_NewInterpreter() and Py_Initialize()

    I am working on a C++ win32 DLL which has calls to python, mainly import some modules, call some functions and return some values. Right now I am using the Py_Initialize() and Py_Uninitialize () functions to get to the embedded interpreter. I am having an issue with making repeated calls to the function(s) that my DLL exports, namely I get an error trying to import a python module that I imported the previous time I placed a call to that DLL.

    What I am seeing leads me to believe that there are some cleanup issues and I would like to get a better idea of what Py_Initialize does vs. what Py_NewInterpret er() does. Does Py_Initialize just create a new thread in the existing interpreter, in which do I need to acquire a lock before using that thread?

    Any insight would be greatly appreciated. TIA
Working...