在Python初始化之前
In an application embedding Python, the Py_Initialize()
function must be called before using any other Python/C API functions; with the exception of a few functions and the global configuration variables.
在初始化Python之前,可以安全地调用以下函数:
配置函数:
信息函数:
工具
内存分配器:
注解
以下函数 不应该 在 Py_Initialize()
: Py_EncodeLocale()
, Py_GetPath()
, Py_GetPrefix()
, Py_GetExecPrefix()
, Py_GetProgramFullPath()
, Py_GetPythonHome()
, Py_GetProgramName()
和 PyEval_InitThreads()
前调用。