C Python extension to export an Function

Ganesh Pal ganesh1pal at gmail.com
Thu Sep 1 08:30:53 EDT 2016


On Thu, Sep 1, 2016 at 12:32 PM, dieter <dieter at handshake.de> wrote:

> Ganesh Pal <ganesh1pal at gmail.com> writes:
>
> > Iam pretty new to C Python extension , I was able to export few simple
> > modules to python and it look like the cool thing to do ...
>
> Maybe, it is a good idea to have a look at "cython".
>
> "cython" is a compiler. It translates Python code enhanced with
> special annotations into C. The annotations mostly tell the compiler
> that something ("object", "method", "function", ...) should be at "C"
> rather than "Python" level, thus avoiding much of Python's overhead
> and allows to do things possible in "C" but not in "Python".
>
>
> Developing safe "C" extensions for Python is difficult. You
> need some quite deep understanding of the Python-C interface
> and must be very careful to observe all requirements (especially
> those related to proper reference management).
>
> Developing "C" extensions with "cython" is much easier as
> "cython" hides many of the complexities and takes care of most
> requirements.
>

Dear  Dieter ,

Really appreciate the reply and your suggestion on  trying to use "cython"
,  but my whole idea of using  "C" extension is to regular C codes .  We
have bunch of C code that's already available and   C -Python seems to suit
me better

Regards,
Ganesh



More information about the Python-list mailing list