#include #include #include int main() { //Initialize python Py_Initialize(); PyEval_InitThreads(); do { PyObject *mod; PyThreadState * tstate; tstate = Py_NewInterpreter(); PyThreadState_Swap(tstate); mod = PyImport_ImportModule("large_import"); if(!mod){ printf("Unable to import module"); exit(1); } Py_DECREF(mod); Py_EndInterpreter(tstate); printf("Relooping...\n"); }while(1); Py_Finalize(); }