Embedding Cython

Typically Cython is used to create extension modules for use from Python programs. One may, however, one want to write a standalone program in Cython. This is done via embedding the Python interpreter with the --embed option.

Background

Status

This has been implemented--simply run cython with the --embed option and a .c file with a main method is created and the module's name will be set to __main__. Compile the .c file linking with the Python library. Running the resulting executable execute the module.

A demo is up at http://hg.cython.org/cython/file/tip/Demos/embed.

EmbeddingCython (last edited 2009-08-07 04:07:52 by robertwb)