When called cython
on the command line, you can tell him to create a method int main()
that implements the Python interpreter:
$ cython --embed main.pyx
$ grep 'int main' main.c
int main(int argc, char** argv) {
However, when you are import Cython
directly, for example. from the distutils
setup.py
script parameter embed
seems to be ignored:
$ python3
>>> from Cython.Compiler import Options
>>> Options.embed = True
>>> from Cython.Build import cythonize
>>> cythonize('main.pyx')
[1/1] Cythonizing main.pyx
>>>
$ grep 'int main' main.c
$
What am I doing wrong here?
source
share