encyclopegia.org

Pyrex (programming language)

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. 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. 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. 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. 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.…

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. 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. 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. 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. 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. If adjustments to the API are needed, glue code must again be written manually. ==See also== Cython ==References== ==External links==

References

  1. Mark Lutz (2006). Programming Python . O'Reilly Media . p. 1461. ISBN 9780596554613 . Wikipedia revision 1358465364, retrieved 2026-11-18 · retrieved 2026-11-17 · rev 1358465364
    Cite this reference

    MLA "Mark Lutz (2006). Programming Python . O'Reilly Media . p. 1461. ISBN 9780596554613 . Wikipedia revision 1358465364, retrieved 2026-11-18." Mark Lutz (2006). 2026-11-17. https://books.google.com/books?id=tN7JAceyJdUC&pg=PA1461. Accessed 24 November 2026.

    Chicago "Mark Lutz (2006). Programming Python . O'Reilly Media . p. 1461. ISBN 9780596554613 . Wikipedia revision 1358465364, retrieved 2026-11-18." Mark Lutz (2006). 2026-11-17. https://books.google.com/books?id=tN7JAceyJdUC&pg=PA1461.

    APA Mark Lutz (2006). (2026). Mark Lutz (2006). Programming Python . O'Reilly Media . p. 1461. ISBN 9780596554613 . Wikipedia revision 1358465364, retrieved 2026-11-18. Retrieved November 24, 2026, from https://books.google.com/books?id=tN7JAceyJdUC&pg=PA1461

  2. Alex Martelli (2009). Python in a Nutshell . O'Reilly Media . p. 650. ISBN 9781449379100 . Wikipedia revision 1358465364, retrieved 2026-11-18 · retrieved 2026-11-17 · rev 1358465364
    Cite this reference

    MLA "Alex Martelli (2009). Python in a Nutshell . O'Reilly Media . p. 650. ISBN 9781449379100 . Wikipedia revision 1358465364, retrieved 2026-11-18." Alex Martelli (2009). 2026-11-17. https://books.google.com/books?id=JnR9hQA3SncC&pg=PA650. Accessed 24 November 2026.

    Chicago "Alex Martelli (2009). Python in a Nutshell . O'Reilly Media . p. 650. ISBN 9781449379100 . Wikipedia revision 1358465364, retrieved 2026-11-18." Alex Martelli (2009). 2026-11-17. https://books.google.com/books?id=JnR9hQA3SncC&pg=PA650.

    APA Alex Martelli (2009). (2026). Alex Martelli (2009). Python in a Nutshell . O'Reilly Media . p. 650. ISBN 9781449379100 . Wikipedia revision 1358465364, retrieved 2026-11-18. Retrieved November 24, 2026, from https://books.google.com/books?id=JnR9hQA3SncC&pg=PA650

  3. Jang Hyuk Kwon; Thom Dunning; Kum Won Cho; Aurore Savoy-Navarro (2010). Future Application and Middleware Technology on E-Science . Springer US . p. 141. ISBN 9781441917195 . Wikipedia revision 1358465364, retrieved 2026-11-18 · retrieved 2026-11-17 · rev 1358465364
    Cite this reference

    MLA "Jang Hyuk Kwon; Thom Dunning; Kum Won Cho; Aurore Savoy-Navarro (2010). Future Application and Middleware Technology on E-Science . Springer US . p. 141. ISBN 9781441917195 . Wikipedia revision 1358465364, retrieved 2026-11-18." Jang Hyuk Kwon; Thom Dunning; Kum Won Cho; Aurore Savoy-Navarro (2010). 2026-11-17. https://books.google.com/books?id=sxOaIiQgpxoC&pg=PA141. Accessed 24 November 2026.

    Chicago "Jang Hyuk Kwon; Thom Dunning; Kum Won Cho; Aurore Savoy-Navarro (2010). Future Application and Middleware Technology on E-Science . Springer US . p. 141. ISBN 9781441917195 . Wikipedia revision 1358465364, retrieved 2026-11-18." Jang Hyuk Kwon; Thom Dunning; Kum Won Cho; Aurore Savoy-Navarro (2010). 2026-11-17. https://books.google.com/books?id=sxOaIiQgpxoC&pg=PA141.

    APA Jang Hyuk Kwon; Thom Dunning; Kum Won Cho; Aurore Savoy-Navarro (2010). (2026). Jang Hyuk Kwon; Thom Dunning; Kum Won Cho; Aurore Savoy-Navarro (2010). Future Application and Middleware Technology on E-Science . Springer US . p. 141. ISBN 9781441917195 . Wikipedia revision 1358465364, retrieved 2026-11-18. Retrieved November 24, 2026, from https://books.google.com/books?id=sxOaIiQgpxoC&pg=PA141

  4. Wesley Chun (2012). Core Python Applications Programming . Prentice Hall . p. 385. ISBN 9780132678209 . Wikipedia revision 1358465364, retrieved 2026-11-18 · retrieved 2026-11-17 · rev 1358465364
    Cite this reference

    MLA "Wesley Chun (2012). Core Python Applications Programming . Prentice Hall . p. 385. ISBN 9780132678209 . Wikipedia revision 1358465364, retrieved 2026-11-18." Wesley Chun (2012). 2026-11-17. https://books.google.com/books?id=7rm0WIhFjFcC. Accessed 24 November 2026.

    Chicago "Wesley Chun (2012). Core Python Applications Programming . Prentice Hall . p. 385. ISBN 9780132678209 . Wikipedia revision 1358465364, retrieved 2026-11-18." Wesley Chun (2012). 2026-11-17. https://books.google.com/books?id=7rm0WIhFjFcC.

    APA Wesley Chun (2012). (2026). Wesley Chun (2012). Core Python Applications Programming . Prentice Hall . p. 385. ISBN 9780132678209 . Wikipedia revision 1358465364, retrieved 2026-11-18. Retrieved November 24, 2026, from https://books.google.com/books?id=7rm0WIhFjFcC

  5. ANN: Pyrex — a language for writing Python extension modules · retrieved 2026-11-17 · rev 1358465364
    Cite this reference

    MLA "ANN: Pyrex — a language for writing Python extension modules." greg at cosc (3 April 2002). 2026-11-17. http://www.gossamer-threads.com/lists/python/python/96585#96585. Accessed 24 November 2026.

    Chicago "ANN: Pyrex — a language for writing Python extension modules." greg at cosc (3 April 2002). 2026-11-17. http://www.gossamer-threads.com/lists/python/python/96585#96585.

    APA greg at cosc (3 April 2002). (2026). ANN: Pyrex — a language for writing Python extension modules. Retrieved November 24, 2026, from http://www.gossamer-threads.com/lists/python/python/96585#96585

Cite this article

MLA

"Pyrex (programming language)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/pyrex-programming-language. Accessed 24 November 2026.

Chicago

"Pyrex (programming language)." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/pyrex-programming-language.

APA

encyclopegia.org. (2026). Pyrex (programming language). Retrieved November 24, 2026, from https://encyclopegia.org/wiki/pyrex-programming-language

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

official language

stub · references available

pan-Slavic language

stub · references available

Hawaiʻi Sign Language

stub · references available

Taiwanese Sign Language

stub · references available

Category:Programming languages

stub · references available

International Mother Language Day

stub · references available

polysynthetic language

stub · references available

Category:Films by country or language

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1358465364 · 0.5 · snapshot enwiki-001358465364

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.