Severe c-module problem
Rolf Wester
wester at ilt.fhg.de
Fri Apr 4 05:52:59 EST 2003
Hi,
I have a c-Module "pyopt" with a function:
static PyObject *_wrap_c_nlo_init_Hs(PyObject *self, PyObject *args) {
PyObject *resultobj;
char * arg0;
cout << "in init_Hs" << endl;
if(!PyArg_ParseTuple(args,(char *)"ss:c_nlo_init_Hs", &arg0))
return NULL;
cout << "in init_Hs: " << arg0 << endl;
c_nlo_init_Hs(arg0);
Py_INCREF(Py_None);
resultobj = Py_None;
return resultobj;
}
If I invoke this function (iteractively from within Xemacs):
import pyopt
pyopt.c_nlo_init_Hs("name")
pyopt.c_nlo_init_Hs("name", 1.0)
pyopt.c_nlo_init_Hs("name", "1.0")
I get:
>>> ## working on region in file /usr/tmp/python-aEF22U...
in init_Hs
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/tmp/python-aEF22U", line 1, in ?
pyopt.c_nlo_init_Hs(nlo.get_name())
TypeError: c_nlo_init_Hs() takes exactly 2 arguments (1 given)
>>> ## working on region in file /usr/tmp/python-aEFDBb...
in init_Hs
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/tmp/python-aEFDBb", line 1, in ?
pyopt.c_nlo_init_Hs(nlo.get_name(), 1.0)
TypeError: c_nlo_init_Hs() argument 2 must be string, not float
>>> ## working on region in file /usr/tmp/python-aEFQLh...
in init_Hs
Process Python segmentation fault
I have no idea what could be wrong. I would be very appreaciative for
any help.
Thanks in advance
Rolf
More information about the Python-list
mailing list