Re: [Cython] Creating python bindings for C library using Cython

2009-06-01 Thread Stefan Behnel
Dag Sverre Seljebotn wrote: > Chris Colbert wrote: >> python strings are automagically converted to char* by cython. > I'll beat Stefan to it and note some very important points here. > [...] > (Perhaps somebody could make this a FAQ entry in the wiki if it is not > already?) http://wiki.cython.

Re: [Cython] Creating python bindings for C library using Cython

2009-06-01 Thread Chris Colbert
I never mind being corrected/updated/put-in-my-place with such a great answer. So there you have it :) Cheers! On Mon, Jun 1, 2009 at 3:09 PM, Dag Sverre Seljebotn < da...@student.matnat.uio.no> wrote: > Chris Colbert wrote: > > python strings are automagically converted to char* by cython. > I

Re: [Cython] Creating python bindings for C library using Cython

2009-06-01 Thread Dag Sverre Seljebotn
Chris Colbert wrote: > python strings are automagically converted to char* by cython. I'll beat Stefan to it and note some very important points here. This applies if you actually have a string (e.g. could be stored in "unicode" in Py2), not if you have raw byte data ("bytes" in Py3). 1) A C cha

Re: [Cython] Creating python bindings for C library using Cython

2009-06-01 Thread Chris Colbert
python strings are automagically converted to char* by cython. You can also look at a wrapper i'm building for the OpenCV library. cython-opencv at google code. Chris On Mon, Jun 1, 2009 at 6:38 AM, Amit Sethi wrote: > > hi , > I guess this needs to go on cython-users but i did not see any such

Re: [Cython] Creating python bindings for C library using Cython

2009-06-01 Thread Lisandro Dalcin
On Mon, Jun 1, 2009 at 10:38 AM, Amit Sethi wrote: > > hi , > I guess this needs to go on cython-users but i did not see any such mailing > list so I am posting it here , > I am trying to create python bindings for a library written in C , > But I am wondering as to how I am suppose to handle poin

[Cython] Creating python bindings for C library using Cython

2009-06-01 Thread Amit Sethi
hi , I guess this needs to go on cython-users but i did not see any such mailing list so I am posting it here , I am trying to create python bindings for a library written in C , But I am wondering as to how I am suppose to handle pointers. For example for the C function, int * analyse_row (int l