タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

cythonに関するbojovsのブックマーク (2)

  • Hello Cython World – taichino.com

    lxmlのソースを読もうとしたらcythonというPythonの拡張を書くためのPythonとCの間の子みたいな言語で書かれているという事で、全く知らないままだとlxmlのソースに挑む気が起こらなかったので少し調べてみました。まぁ調べてみたといってもcythonのドキュメントの最初に書かれているGetting Startedを舐めただけなんですけども。 まずcythonをインストールします。 $ easy_install cython そして恒例のhello worldは以下になります。拡張子は.pyxを使うようです。 # hello.pyx def say_hello_to(name): print 'Hello %s' % name どう見てもPythonのコードなので楽勝なのですが、これを使えるようにsetup.pyを書かねばなりません。少しだけ面倒ですね。以下のように基は通常のs

  • Cython: C-Extensions for Python

    About Cython Cython is an optimising static compiler for both the Python programming language and the extended Cython programming language (based on Pyrex). It makes writing C extensions for Python as easy as Python itself. Cython gives you the combined power of Python and C to let you write Python code that calls back and forth from and to C or C++ code natively at any point. easily tune readable

  • 1