From f9abaf42f840cb5c3c60a1052177209072b885cb Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 31 Jan 2001 22:27:51 +0000 Subject: Simple embedded program that does a module import. Useful for debugging leaks and other memory problems. --- Demo/embed/import.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Demo/embed/import.c diff --git a/Demo/embed/import.c b/Demo/embed/import.c new file mode 100644 index 0000000..375ce1b --- /dev/null +++ b/Demo/embed/import.c @@ -0,0 +1,17 @@ +#include + +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; +} -- cgit v0.12