Re: Problem using python C API

2009-01-16 Thread marcglec
Right, thx for your reply, I completely overlooked "examplemodule.so" in the building step. Maybe I should sleep more these days :) Btw, I've now an other problem with PyArg_ParseTuple but I guess it is better to post in the capi-sig mailing list. Thx again, Marc. > > On Jan 16, 2009, at 5:31 AM,

Re: Problem using python C API

2009-01-16 Thread Philip Semanchuk
On Jan 16, 2009, at 5:31 AM, shi dingan wrote: void initexample() { PyObject *m; m = Py_InitModule("example", exampleMethods); } When I try to import examplemodule, I obtain the following message: import examplemodule Traceback (most recent call last): File "", line 1, in ? ImportError: d

Problem using python C API

2009-01-16 Thread shi dingan
Hi, I'm trying to use the Python C API but I have a problem when importing my new module. Here is my (short) code: #include "Python.h" long sumList(PyObject *list) { int i, n; long total = 0; PyObject *item; n = PyList_Size(list); if (n < 0) return NULL; for (i = 0; i < n; i++) {