#include "kernel/mod2.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/stat.h>
#include "Singular/tok.h"
#include "kernel/structs.h"
#include "Singular/mod_lib.h"
#include "Singular/ipid.h"
#include "Singular/locals.h"
#include "omalloc/omalloc.h"
#include <time.h>
#include <boost/python.hpp>
#include <Python.h>
#include "wrapper.h"
Go to the source code of this file.
◆ mod_python()
Definition at line 25 of file python_module.cc.
26{
27 leftv __v = __h, __v_save;
28 int __tok =
NONE, __index = 0;
30 char * a;
31 if(__v==
NULL)
goto mod_python_error;
34 goto mod_python_error;
38 goto mod_python_error;
39 __v = __v_save;
40 a = (
char *)__za->
Data();
41 if(__v!=
NULL) { __tok = __v->
Typ();
goto mod_python_error; }
42
43 PyRun_SimpleString(a);
47
48 mod_python_error:
50 Werror(
"expected python('string')");
52}
Class used for (list of) interpreter objects.
int iiTestConvert(int inputType, int outputType)
const char * Tok2Cmdname(int tok)
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
void Werror(const char *fmt,...)
◆ python_module()
Definition at line 57 of file python_module.cc.
58{
62 {
66 }
67 else
69 Print(
"setting PYTHONAPTH to %s\n",
buf);
70 setenv(
"PYTHONPATH",
buf,1);
71
72 Py_Initialize();
73 PyRun_SimpleString("from sys import path\n\
74path.insert(0,'.')\n");
75 initSingular();
76 init_Singular();
77
80}
static char * feResource(feResourceConfig config, int warn)
static BOOLEAN mod_python(leftv __res, leftv __h)
int status int void * buf
int(* iiAddCproc)(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))