extending python to C

Adrian Eyre a.eyre at optichrome.com
Tue Sep 28 12:36:34 EDT 1999


> #include <Python.h>
> #include "mymath.h"
>
> PyObject* pyfunc_mystruct(self, args)
> PyObject *self, *args; 
> {
>     PyObject* string_from_Python; 
>     if(!PyArg_ParseTuple(args,"S:mymath",string_from_Python))

I think this line should be:

if (!PyArg_ParseTuple(arg, "S:mymath", &string_from_Python))
notice the ampersand ------------------^

But I'm not 100% sure...

--------------------------------------------
Adrian Eyre <mailto:a.eyre at optichrome.com>
Optichrome Computer Solutions Ltd
Maybury Road, Woking, Surrey, GU21 5HX, UK
Tel: +44 1483 740 233  Fax: +44 1483 760 644
http://www.optichrome.com 
--------------------------------------------





More information about the Python-list mailing list