2001-01-31 18:27:51 -04:00
|
|
|
#include <Python.h>
|
|
|
|
|
2008-10-30 18:48:26 -03:00
|
|
|
#if 0
|
|
|
|
char* cmd = "import codecs, encodings.utf_8, types; print(types)";
|
|
|
|
#else
|
|
|
|
char* cmd = "import types; print(types)";
|
|
|
|
#endif
|
2001-01-31 18:27:51 -04:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2008-10-30 18:48:26 -03:00
|
|
|
printf("Initialize interpreter\n");
|
2001-01-31 18:27:51 -04:00
|
|
|
Py_Initialize();
|
|
|
|
PyEval_InitThreads();
|
|
|
|
PyRun_SimpleString(cmd);
|
|
|
|
Py_EndInterpreter(PyThreadState_Get());
|
|
|
|
|
2008-10-30 18:48:26 -03:00
|
|
|
printf("\nInitialize subinterpreter\n");
|
2001-01-31 18:27:51 -04:00
|
|
|
Py_NewInterpreter();
|
|
|
|
PyRun_SimpleString(cmd);
|
|
|
|
Py_Finalize();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|