[Pyrex] cimport statement for external C functions

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Feb 19 22:53:40 UTC 2007


grahamc001uk wrote:

> If I put the following in file interface.pxd:
> cdef extern from "interface.h":
>     void MyFunction ()
> 
> and the following in my .pyx file:
> cimport interface

You need to refer to it as interface.MyFunction() if
you import it like that.

The alternative would be

   from interface cimport MyFunction

then you could refer to it as just MyFunction().

--
Greg



More information about the Pyrex mailing list