示例#1
0
文件: python.cpp 项目: pywbem/pyprov
int main(int argc, char** argv)
{
    std::cout << "Greetings. Type from example import *; test()" << std::endl;
    Py_Initialize();
    initexample();
    return Py_Main(argc, argv);
}
int __declspec(dllexport) example_init(void)
{
    PyGILState_STATE gilstate_save = PyGILState_Ensure();
    int rc = 0;

#if PY_MAJOR_VERSION < 3
    initexample();
#else
    PyInit_example();
#endif
    if (PyErr_Occurred()) {
        rc = -1;
    }
    PyGILState_Release(gilstate_save);
    return rc;
}