woensdag 28 oktober 2015

python setup.py cython

Content of setup.py


from setuptools import setup, find_packages,Extension, Command

try:
    from Cython.Distutils import build_ext
except ImportError:
    from distutils.command.build_ext import build_ext
    sources=['midistream.c']
else:
    sources=['midistream.pyx']

setup(
    name ='midistream',
    version='1.0',
    packages=find_packages(),
    cmdclass = {'build_ext': build_ext},
    ext_modules=[
    Extension('midistream', ['midistream.pyx'])
    ],
   
)


Rename midistream.py midistream.pyx 


run:

sudo python setup.py build_ext --inplace
sudo python setup.py install

midistream.o and midistream.so are made


Geen opmerkingen:

Een reactie posten