python小记:代码加密

mac2024-06-21  49

方案1:使用pyarmor

官方教程:http://pyarmor.dashingsoft.com/index-zh.html

参考1:https://blog.csdn.net/jackkxs/article/details/89059986

参考2:https://blog.csdn.net/weixin_43572000/article/details/83986683

可以设定代码有效期,绑定到硬件。

我的小小代码暂时还用到这个大杀器,还是简单一点就够了。

 

方案2:使用cython

参考1:https://www.jianshu.com/p/8b93b9044737

1. pip 安装cython pip installl cython 2. 用cython将核心代码py模块文件转化成.c 文件 cython hello.py 或者 cython *.py 3. gcc 编译成so文件 gcc -c -fPIC -I /usr/include/python.2.7/ hello.c gcc -shared hello.o -o hello.so 使用so 文件 就像使用py模块一样引入就可以使用了 import hello.hello as h if __name__=="__main__": h.print()

python的路径可以通过 whereis python 来查看

最新回复(0)