python 中最通用简单的加密cython
文章目录
书写setup.py 文件
https://cython.readthedocs.io/en/latest/src/tutorial/cython_t...
import os
import glob
from distutils.core import setup
from Cython.Build import cythonize
py_files = glob.glob('modules/**/*.py', recursive=True)
# py_files = 'helloworld.py'
setup(
name='zed',
version='3.0',
author='zed',
author_email='zed@email.com',
maintainer='zed',
maintainer_email='',
ext_modules=cythonize(py_files,
nthreads=10,
language_level=3,
build_dir='build/src',
compiler_directives={'always_allow_keywords': True}),
)编译对应的扩展包
python setup.py build_ext -j 10
python setup.py install --install-lib install/
科普编译
- gcc a.c -o a.out 直接快速编译成可执行文件
- gcc -c a.c -o a.o 编译成二进制文件,但是不链接
- gcc -fPIC -shared a.c -o a.so 编译成动态库
- gcc -fPIC -shared a.o -o a.so 编译成动态库

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论