Chamar código python de c via cython

Então, eu gostaria de chamar algum código python de c via cython. Eu consegui chamar o código cython de c. E também posso chamar código python do cython. Mas quando adiciono tudo, algumas coisas estão faltando.

Aqui está o meu código python (quacker.pyx):

def quack():
    print "Quack!"

Aqui está minha "ponte" cython (caller.pyx):

from quacker import quack

cdef public void call_quack():
    quack()

E aqui está o código c (main.c):

#include <Python.h>
#include "caller.h"

int main() {
  Py_Initialize();
  initcaller();
  call_quack();
  Py_Finalize();
  return 0;
}

Quando executo isso, recebo esta exceção:

Exception NameError: "name 'quack' is not defined" in 'caller.call_quack' ignored

As peças que faltam estou suspeitando:

Eu não ligueiinitquacker()Eu não incluíquacker.hCython não produziu nenhumquacker.h - only quacker.ccaller.c não importaquacker.h ou chamarinitquacker()

Não tenho muita certeza de que seja possível fazer o que estou tentando fazer, mas parece-me que deveria ser. Eu adoraria ouvir qualquer opinião que você possa ter.

Editar:

É assim que eu cythonize / compile / link / run:

$ cython *.pyx
$ cc -c *.c -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
$ cc -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -ldl *.o -o main
$ ./main

questionAnswers(2)

yourAnswerToTheQuestion