hello-world icon indicating copy to clipboard operation
hello-world copied to clipboard

Add Cython

Open thatfloflo opened this issue 2 years ago • 0 comments

Adding a language

  • [X] The code displays "Hello World" (tio.run may help for testing)
  • [X] I have no association with the language
  • [X] There are no copyright issues with this code
  • [X] The language has not been added prior to this pull request

Link to programming language:

https://cython.org/ and https://cython.readthedocs.io/en/stable/src/userguide/index.html

To run / test

Make a setup.py (needed for compiling), with the following content:

from setuptools import setup
from Cython.Build import cythonize

setup(ext_modules=cythonize("Cython.pyx"))

Store the setup.py in the same folder as Cython.pyx.

To compile the module, run:

pip install Cython
python setup.py build_ext --inplace

Then execute the module with python -c "import Cython" (needs to be in the same directory as Cython.so / Cython.pyd)

thatfloflo avatar Mar 30 '23 23:03 thatfloflo