Pyrex (programming language)
Template:Use dmy dates Script error: No such module "Infobox".Template:Template other Script error: No such module "Check for unknown parameters".Script error: No such module "Check for conflicting parameters".
Pyrex is a programming language for creating Python modules. Its syntax is very close to Python and it makes it easy for Python programmers to write non-Python supporting code for interfacing modules in a language which is as close to Python as possible.
Python itself only provides a C API to write extension modules, which allows writing of functions and datatypes in C.[discuss] These can then be accessed from Python. It is possible to wrap the functions and datatypes of existing C libraries as Python objects and therefore make them available to Python.[1]
Pyrex allows the user to write extension modules in a Python-like language which may directly access the external C code. The similarity of Pyrex's syntax to Python's makes it easy to write Python modules, but there are some functional limitations.[2] The programmer must specify the name of C-header files, enumerations, datatypes and functions needing to be accessed in the module, then they can be used as if they were Python objects. The Pyrex compiler will generate the necessary glue code automatically and compile the Pyrex code into a working Python module.Script error: No such module "Unsubst".
There are tools like SWIG or Python's foreign function library ctypes which can be used for this task without requiring much additional code, but this is limited to making an external library available in Python code.[3][4] If adjustments to the API are needed, glue code must again be written manually.Script error: No such module "Unsubst".
See also
Script error: No such module "Portal".
References
<templatestyles src="Reflist/styles.css" />
Script error: No such module "Check for unknown parameters".
External links
- Script error: No such module "Official website".Script error: No such module "Check for unknown parameters".