Please note: This wiki is currently running in test mode after an attack on January 5 2013. All passwords were reset, so you will have to use the password recovery function to get a new password. To edit wiki pages, please log in first. See the wiki attack description page for more details. If you find problems, please report them to the pydotorg-www mailing list.

Pyrex is a Python-like language for rapidly and easily writing python extension modules. It can be described as python with C data types. With Pyrex, one can produce Python-like code that runs as fast as in C, with easy access to C libraries and functions.

The Pyrex homepage is at http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/

The two main uses of Pyrex are:

For examples of the speedup that Pyrex provides, see this message. or this page.

There is an enhanced fork of Pyrex, called Cython. It features substantial performance optimisations and improved support for newer Python language features.

PyrexOnWindows provides a step-by-step guide to Pyrex installation on Windows.

pyrexdoc is a tool for generating HTML documentation from a compiled Pyrex module, by DavidMcNab. See other DocumentationTools.

If you are looking for speed improvement, you may also want to consider other Python speedup solutions such as psyco and weave.

For accessing existing C libraries, the ctypes module is also available in Python 2.5 and above.

Pyrex (last edited 2009-11-11 19:14:56 by 38)