When called cythonon 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 Cythondirectly, for example. from the distutils setup.pyscript parameter embedseems 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