[Numpy-discussion] Help: Problem embedding Python with Numeric

Aureli Soria Frisch Aureli.Soria_Frisch at ipk.fhg.de
Fri Aug 31 10:54:03 EDT 2001


Hello,

I am writing a C program, which uses a class I have written in Python. The
class has a method 'operate_image' that receives as parameters a Numeric
array, an integer and a float.

The class has been repeatedly used with no problems.

When I try to call the method I use:

pres_fi=PyObject_CallMethod(pFI,"operate_image","(Oif)",parray,1,1.0);

But the result (pres-fi) is NULL. I have tested pFI to exist and to have
the mentioned method, with no troubles.

So it seems to me that PyObject_CallMethod is casting down the parray
object, which is a PyArrayObject. That is the reason of malfunctioning.

Questions:
1) Is my interpratation right?
2) Which would be the correct way to do such an operation?

It is the first time I write an Python embedded/extension, so I am quite lost.

Thanks in advance,
Aureli


#################################
Aureli Soria Frisch
Fraunhofer IPK
Dept. Pattern Recognition

post: Pascalstr. 8-9, 10587 Berlin, Germany
e-mail:aureli at ipk.fhg.de
fon: +49 30 39006-150
fax: +49 30 3917517
#################################






More information about the NumPy-Discussion mailing list