On Mon, Sep 29, 2008 at 3:40 AM, Amir <[EMAIL PROTECTED]> wrote: > > I would like to create a simple embedded cython executable like the example in > the Python docs (5. Embedding Python in Another Application). I started with > the > Cython wiki link pointing to David McNab's pyrex embedding tutorial but am not > sure how to proceed. Was wondering if anyone had done this with a recent > Cython > version.
Cython is primarily targeted to build extension modules, and not executables embeding Python. However, Cython could provide support for this, though perhaps that is not strongly needed, as things could be done more or less easy writting some C code making appropriate Python C-API calls (Py_Initialize, Py_Finalize, PyRun_SimpleString, etc.). > The python pxd's don't seem to have Py_Initialize, Py_Finalize, PySys_SetArgv > used in David's tutorial. I'm guessing there is a good reason for this. And I > am > wondering if there is a way to use Cython.distutils to build the executable. > I have some custom support for building python executable in my mpi4py project. Look at http://code.google.com/p/mpi4py/source/browse/trunk/conf/mpidistutils.py . You will find some distutils command 'build_exe', 'install_exe', and 'clean_exe', and a Executable class (is just inherit from Extension, but do not extend it in any way). Of course, you will need to remove the MPI-configuration related stuff. Additionally, this was never tried on Windows, and likely will not work in that platform. > Any pointers to docs or an example application would be appreciated. > Feel free to contact me by private mail if you have trouble. Regards, > > > > _______________________________________________ > Cython-dev mailing list > [email protected] > http://codespeak.net/mailman/listinfo/cython-dev > -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
