زبان برنامهنویسی سازگار با پایتون From Wikipedia, the free encyclopedia
سایتون (به انگلیسی: cython) یک زبان برنامهنویسی برای توسعه ماژول برای پایتون میباشد
پرونده:Cython-logo.svg | |
توسعهدهنده(ها) | Robert Bradshaw, Stefan Behnel, et al. |
---|---|
انتشار اولیه | ۲۸ ژوئیه ۲۰۰۷[1] |
مخزن | |
نوشتهشده با | Python, C |
سیستمعامل | چند سکویی |
نوع | زبان برنامه نویسی |
مجوز | مجوز آپاچی |
وبگاه |
شیوه کار این زبان برنامهنویسی بدین صورت است که:
این یک مثال ساده برای ساخت یک ماژول با سایتون است که بتواند عبارت "hello world" را چاپ کند
# hello.pyx
def say_hello():
print "Hello World!"
# setup.py
from distutils.core import setup
from Cython.Build import cythonize
setup(name = 'Hello world app',
ext_modules = cythonize("*.pyx"))
# launch.py
# This code is always interpreted, like normal Python.
# It is not compiled to C.
import hello
hello.say_hello()
$ python setup.py build_ext --inplace
$ python launch.py
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.