Embedding a Numeric array in C

Chris Fonnesbeck spam at fisher.forestry.uga.edu
Tue May 21 17:48:59 EDT 2002


I thought that weave was for extending, rather than embedding, C/C++.
Its not apparent (to me) how to use blitz to embed python into C. All
I am trying to do is run a python function (which contains Numeric
classes) from within C, and get it to return a number. Shouldnt be
anything TOO complicated.

Thanks,
C.

Fernando Pérez <fperez528 at yahoo.com> wrote in message news:<acc2jb$1r5$2 at peabody.colorado.edu>...
> Chris Fonnesbeck wrote:
> 
> > I am trying to find out how to properly embed a Numeric array type in
> > C.  The following code compiles, but segfaults when run:
> > 
> 
> Don't sweat it. Use weave (http://scipy.org) with blitz if you can. It's far 
> easier than writing your own typemaps correctly (a non-trivial task), and 
> will probably be enough in 90% of the cases.
> 
> At http://www-hep.colorado.edu/~fperez/python/python-c/ you'll find some 
> examples of weave use with Numeric arrays to get you started.
> 
> Cheers,
> 
> f.



More information about the Python-list mailing list