Simple embedded program that does a module import. Useful for

debugging leaks and other memory problems.
This commit is contained in:
Barry Warsaw 2001-01-31 22:27:51 +00:00
parent 2df3c41e78
commit f9abaf42f8
1 changed files with 17 additions and 0 deletions

17
Demo/embed/import.c Normal file
View File

@ -0,0 +1,17 @@
#include <Python.h>
char* cmd = "import exceptions";
int main()
{
Py_Initialize();
PyEval_InitThreads();
PyRun_SimpleString(cmd);
Py_EndInterpreter(PyThreadState_Get());
Py_NewInterpreter();
PyRun_SimpleString(cmd);
Py_Finalize();
return 0;
}