美文网首页
树莓派安装cython加密python文件

树莓派安装cython加密python文件

作者: 鹏鹏Song | 来源:发表于2019-08-10 08:43 被阅读0次

1.安装cython

sudo apt-get install cython

2.目标加密文件dataHandle.py,cd到文件目录下

sudo cython -a dataHandle.py

3. 把生成的dataHandle.c 变成dataHandle.so

gcc -shared -pthread -fPIC -fwrapv -O2 -Wall -fno-strict-aliasing -I/usr/include/python3.7 -o dataHandle.so dataHandle.c

4.删掉dataHandle.py,只留dataHandle.so,再次执行项目正常运行不受影响。

windows平台快捷打包方法:

1. pip install pyinstaller

2. cd 到程序文件加下

3. pyinstaller main.py  成功后dist文件夹下生成main.exe(删除其他的源程序,留下main.exe)

相关文章

网友评论

      本文标题:树莓派安装cython加密python文件

      本文链接:https://www.haomeiwen.com/subject/zwbvettx.html