Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: d434e9f672961946e8c2cbe603f23dd275546bb2 authored by Barry Warsaw on 07 November 2008, 03:08:42 UTC
De-tagging
Tip revision: d434e9f
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