Pyrex source code
File type: Source code and script file
A pyx file contains source code written in the Pyrex programming language, which is used to create Python extension modules.
File type category:
Source code and script file
Date updated: November 22, 2026
Pyrex, created by Greg Ewing, is a programming language and compiler for writing Python extension modules. Pyrex source combines Python-like code with declarations for C types and functions.
The Pyrex compiler translates a .pyx file into C source code, which can then be built as a Python extension module. Pyrex is a legacy toolchain; Cython developed from Pyrex and is its more widely used successor. Pyrex software is available for Microsoft Windows.
To inspect the source, open the .pyx file in any text editor. To compile it, use the Pyrex compiler on Windows; viewing the code does not require the compiler.
The Pyrex compiler can translate a .pyx file into C source code, which must then be built into a Python extension module. Pyrex code that uses C-level features cannot generally be converted to ordinary Python source without changing its behavior.
text/x-cython