Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 6046c5e0298c25515ea58abc8ab87f7413e3f743 authored by Barry Warsaw on 03 December 2008, 17:29:10 UTC
Oops, one revision we forgot.
Tip revision: 6046c5e
importexc.c
#include <Python.h>

#if 0
char* cmd = "import codecs, encodings.utf_8, types; print(types)";
#else
char* cmd = "import types; print(types)";
#endif

int main()
{
	printf("Initialize interpreter\n");
	Py_Initialize();
	PyEval_InitThreads();
	PyRun_SimpleString(cmd);
	Py_EndInterpreter(PyThreadState_Get());

	printf("\nInitialize subinterpreter\n");
	Py_NewInterpreter();
	PyRun_SimpleString(cmd);
	Py_Finalize();

	return 0;
}
back to top