Last active
August 16, 2024 12:38
-
-
Save nrtkbb/5b65d2f5ed42bd9947b5 to your computer and use it in GitHub Desktop.
Hello Cython in Maya
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install pip | |
# $ curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python | |
# | |
# Install Cython | |
# $ pip install cython | |
# | |
# compile command | |
python setup.py build_ext --inplace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This is pure python file. | |
Called from maya | |
""" | |
import helloworld | |
def hello(): | |
helloworld.hello() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This is cython file. | |
Compiled from setup.py and python ( same version to mayapy ) | |
""" | |
def hello(): | |
print "Hello World" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from distutils.core import setup | |
from distutils.extension import Extension | |
from Cython.Distutils import build_ext | |
setup( | |
cmdclass = {'build_ext': build_ext}, | |
ext_modules = [Extension("helloworld", ["helloworld.pyx"])] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment