Pyrex lets you write code that mixes Python and C data types any way you want, and compiles it into a C extension for Python.This has the (for me) significant advantage that there is no need to install scipy and gcc on any computer that you want your code to run on (as compared to the scipy.weave model). Distributing the compiled extension file is enough.
To make Pyrex work on Windows follow these instructions (here seems to be a copy). As usual you have to change something a bit to make it work with gcc. The key step of these instructions is creation (or edit) of distutils.cfg and adding these lines into it:
[build]Aside from this I also use a modified python setup command:
compiler = mingw32
python setup.py build-ext --inplaceIt suits me better to have the compiled extension in the working directory and not in Python dir as happens with the 'install' command.
I am aware of the Cython language which has developed from Pyrex but I have not tried it. I guess I don't need to fix what ain't broken ;-) Pyrex works great for me right now.
1 comment:
Thanks for sharing,I'm looking forward for your updates.
Post a Comment