A PYX file is a source code written in the Python-like language Pyrex. It may contain code that references existing C modules. Pyrex is a programming language that is used for creating Python modules PYD and is based on C-like syntax. Using the PYX files, users can write extension modules that may directly access the external C code.
PYX files can be opened with Pyrex that is available on Windows, MacOS and Linux OS.
PYX File Format - More Information
PYX files are plain text files and their syntax is very close to Python. Python provides only a C API to write extension modules. Pyrex speeds up the execution of Python code and provides a Python interface to existing C modules/libraries.