diff options
| author | Lieuwe <lieuwemo@gmail.com> | 2011-03-03 20:12:57 (GMT) |
|---|---|---|
| committer | Lieuwe <lieuwemo@gmail.com> | 2011-03-03 20:12:57 (GMT) |
| commit | fc70b5bb783ff90865f35f20edb8436a8fb7dc40 (patch) | |
| tree | 040d2affaee939cd4e544c928e7f658c73f30f37 /src | |
| parent | eab871c77487714cab68b9e4753a2bcf7ece79f4 (diff) | |
| download | powder-fc70b5bb783ff90865f35f20edb8436a8fb7dc40.zip powder-fc70b5bb783ff90865f35f20edb8436a8fb7dc40.tar.gz | |
tpt_console.py now internal
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 { |
