Message400049
How about this one?
int foo(void)
{
printf(stderr, "foo BEGIN\n");
if (!Py_IsInitialized()) {
fprintf(stderr, "python already initialized\n");
return -1;
}
const char *module_name = "foo";
PyGILState_STATE state = PyGILState_Ensure();
PyObject *module_handle = PyModule_New(module_name);
if (module_handle == 0)
{
fprintf(stderr,"PyModule_New(module_data_name=%s) failed\n",
module_name);
exit(1);
}
fprintf(stdout, "point is: %p\n", module_handle);
fprintf(stderr, "foo END\n");
PyGILState_Release(state);
return 0;
} |
|
Date |
User |
Action |
Args |
2021-08-22 03:42:50 | shihai1991 | set | recipients:
+ shihai1991, enometh |
2021-08-22 03:42:50 | shihai1991 | set | messageid: <1629603770.32.0.682495978946.issue44913@roundup.psfhosted.org> |
2021-08-22 03:42:50 | shihai1991 | link | issue44913 messages |
2021-08-22 03:42:50 | shihai1991 | create | |
|