Skip to content

Instantly share code, notes, and snippets.

@phaustin
Last active March 5, 2016 21:11
Show Gist options
  • Select an option

  • Save phaustin/136c7cd4ed297d5f0a04 to your computer and use it in GitHub Desktop.

Select an option

Save phaustin/136c7cd4ed297d5f0a04 to your computer and use it in GitHub Desktop.
Readme_cython.org

git clone https://github.com/thewtex/cython-cmake-example.git

#http://thread.gmane.org/gmane.comp.python.cython.user/11977/focus=12025

from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize import sys

sys.argv = [‘setup.py’, ‘build_ext’, ‘–inplace’]

extensions = [ Extension( “test”, [“test.pyx”], extra_compile_args = [ ‘-Wno-unused-function’, ‘-stdlib=libc++’, ‘-std=c++11’, ‘-mmacosx-version-min=10.8’, ], ) ] setup( name=’test’, ext_modules=cythonize( extensions, ) )

from libcpp.map cimport map from libcpp.string cimport string

def f(): cdef map[int,int] mymap mymap[3]=10 print mymap[3]

test3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment