Python extension using a C library with one 'hello' function

Chris Angelico rosuav at gmail.com
Tue Nov 4 09:57:11 EST 2014


On Tue, Nov 4, 2014 at 8:52 PM, Veek M <vek.m1234 at gmail.com> wrote:
> https://github.com/Veek/Python/tree/master/junk/hello
> doesn't work.
> I have:
> hello.c which contains: int hello(void);
> hello.h
>
> To wrap that up, i have:
> hello.py -> _hello (c extension) -> pyhello.c -> method py_hello()
>
> People using this will do:
> python3.2>> import hello
> python3.2>> hello.hello()
>
> It doesn't compile/work.
> [details chomped]

Have you considered using Cython? It'll likely make your job a LOT easier.

ChrisA



More information about the Python-list mailing list