diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -24,6 +24,8 @@ */ #include "Python.h" +#include "pyconsole.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1828,11 +1830,13 @@ int main(int argc, char *argv[]) PyRun_SimpleString("import sys\nsys.path.append('.')"); PyRun_SimpleString("print 'python present.'"); //load the console module and whatnot - pname=PyString_FromString("tpt_console");//create string object - pmodule = PyImport_Import(pname);//import module + //pname=PyString_FromString("tpt_console");//create string object + //pmodule = PyImport_Import(pname);//import module + PyObject *tpt_console_obj = PyMarshal_ReadObjectFromString(tpt_console_pyc+8, sizeof(tpt_console_pyc)-8); + pmodule=PyImport_ExecCodeModule("tpt_console", tpt_console_obj); if(pmodule!=NULL) { - Py_DECREF(pname);//throw away the string object + //Py_DECREF(pname);//throw away the string object pfunc=PyObject_GetAttrString(pmodule,"handle");//get the handler function if(pfunc && PyCallable_Check(pfunc))//check if it's really a function { |
