[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Mixing Python and C in games



On Fri, 17 Feb 2006 16:10:42 +0200, "Sami Hangaslammi"
<sami.hangaslammi@xxxxxxxxx> said:
> On 2/17/06, David Mikesell <dave_mikesell@xxxxxxxxxxx> wrote:
> > I'm not completely clear on what your trying to do - are you wanting to
> > wrap C code in Python?  If so, have you looked at SWIG?   I used SWIG to
> > wrap C++ code in Perl a few years back and it was fairly easy.
> 
> What I'm trying to do, is to rewrite some of the algorithms in my
> framework in C (it's currently 100% Python). I guess SWIG is an option
> too, although it also gave me the impression that its better suited to
> wrapping a whole, exisiting C-library for Python.

You can wrap as little or as much as you like - the input to the SWIG
compiler is a list of the headers of the code to be wrapped.