Python代码混淆
摘自:http://yshblog.com/blog/117
pip install cython
安装Cython之后,还需要指定vcvarsall.bat的位置。
vcvarsall.bat是VC编译Python环境的文件之一。而vcvarsall.bat需要安装VC For Python2.7。我的Python是2.7,刚好可以使用这个。至于3.x版本不知道微软更新了没有。
下载地址:VCForPython27.msi
安装成功之后,再修改设置。让Cython可以找到vcarsall.bat。此处有两种方案。
方案2:修改注册表
#coding:utf-8 def hello(): print("Hello world") input("<press ENTER to quit>")
from distutils.core import setup from Cython.Build import cythonize setup( name = \'Hello world app\', ext_modules = cythonize("test.py"), )
python setup.py build_ext --inplace
import test if __name__=="__main__": test.hello()