diff options
| author | Lieuwe <lieuwemo@gmail.com> | 2011-03-13 17:45:40 (GMT) |
|---|---|---|
| committer | Lieuwe <lieuwemo@gmail.com> | 2011-03-13 17:45:40 (GMT) |
| commit | c33f6adae7f8033202cdfd20f97008f40391db07 (patch) | |
| tree | 91698270ba6b076c9fcd5b503c7f1744149e23ab /src | |
| parent | db07c1ee0cd853926c01ce99f48d53211bf94f0d (diff) | |
| download | powder-c33f6adae7f8033202cdfd20f97008f40391db07.zip powder-c33f6adae7f8033202cdfd20f97008f40391db07.tar.gz | |
added #define PYEXT so you can use an external tpt_console.py on 64bit OSes
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -27,8 +27,10 @@ #ifdef PYCONSOLE #include "Python.h" +#ifndef PYEXT #include "pyconsole.h" #endif +#endif #include <stdio.h> #include <stdlib.h> @@ -1972,10 +1974,15 @@ 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 + #ifdef PYEXT + printf("using external python console file.\n"); + pname=PyString_FromString("tpt_console");//create string object + pmodule = PyImport_Import(pname);//import module + Py_DECREF(pname);//throw away string + #else PyObject *tpt_console_obj = PyMarshal_ReadObjectFromString(tpt_console_pyc+8, sizeof(tpt_console_pyc)-8); pmodule=PyImport_ExecCodeModule("tpt_console", tpt_console_obj); + #endif if(pmodule!=NULL) { //Py_DECREF(pname);//throw away the string object |
