C + + library
python call
Objdll = ctypes.cdll.LoadLibrary(“libpythontest.dll”)
Objdll.test_init()
for i in range(1,100):
time.sleep(1)
print(‘finish’)
The program crashed during debugging,for the function:
PyImport_ImportModule(“code”)
and, then function execution failed to be traced through source code
PyEval_GetGlobals();
return null
First, Py_IsInitialized() return true, I don’t know why and if it makes any difference.
And, the result is the same whether I call Py_Initialize in the lib.
I don’t know if Python supports mutual invocation, or what mechanism is missed.