/Demo/embed/importexc.c
http://unladen-swallow.googlecode.com/ · C · 17 lines · 13 code · 4 blank · 0 comment · 0 complexity · a3ef144e6b0689cafdae58d167e029c8 MD5 · raw file
- #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;
- }