From: Barry Warsaw Date: Wed, 31 Jan 2001 22:27:51 +0000 (+0000) Subject: Simple embedded program that does a module import. Useful for X-Git-Tag: v2.1a2~60 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f9abaf42f840cb5c3c60a1052177209072b885cb;p=python Simple embedded program that does a module import. Useful for debugging leaks and other memory problems. --- diff --git a/Demo/embed/import.c b/Demo/embed/import.c new file mode 100644 index 0000000000..375ce1b686 --- /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; +}