User Tools

Site Tools


python

This is an old revision of the document!


Python bindng

간단한 cad를 만들어 보는게 목표 - glfw, glew을 binding 하여 써보자. - geode 분석 - cygl 분석 https://github.com/pupil-labs/pyglui

Cython helloworld

Reference: https://media.readthedocs.org/pdf/cython/latest/cython.pdf

setup.py

from distutils.core import setup
from Cython.Build import cythonize

setup(
    name = "My hello app",
    ext_modules = cythonize('hello.pyx'),  # accepts a glob pattern
)

hello.pyx

def say_hello_to(name):
	print("Hello %s!" % name)

hello.pyd 생성하기. mingw32가 설치되고 패스가 걸려 있어야 함.

python setup.py build_ext --inplace --compiler=mingw32

hello.c만 생성하고 싶은 경우

cython -e hello.pyx

를 해서 커맨드라인에서 hello.c를 생성할 수 있다.

python.1419756017.txt.gz · Last modified: 2018/07/18 14:09 (external edit)