Embedding a Numeric array in C
Chris Fonnesbeck
spam at fisher.forestry.uga.edu
Mon May 20 17:11:54 EDT 2002
I am trying to find out how to properly embed a Numeric array type in
C. The following code compiles, but segfaults when run:
#include <Python.h>
#include <pythonrun.h>
#include <Numeric/arrayobject.h>
int main() {
PyObject *pmod;
char *cstr;
Py_Initialize();
pmod = PyImport_ImportModule("Numeric");
Py_DECREF(pmod);
return 0;
}
That is, simply importing the Numeric module causes a crash.
Substituting most other modules works without a hitch.
Any ideas? I'm sure this is easy, but I havent found the answer.
Thanks,
cjf
More information about the Python-list
mailing list