我如何向客户混淆/隐藏我的 Python 代码,使他无法更改源代码?
How can I obfuscate / hide my Python code from the customer, so that he cannot change the source how he likes to?
我知道没有有效的方法可以隐藏 Python 代码,因此无法阅读它.我只是想要一个简单的保护,一个不知道自己在做什么的人不能只用文本编辑器打开源文件,然后轻松地进行更改或理解所有内容.因为我的代码写得很好理解,所以我想隐藏我最初使用的主要原则.
I know there is no effective way to hide Python code, so that there is no way to read it. I just want a simple protection, that someone who doesn't really know what he is doing cannot just open the source files with a text editor and make changes or understand everything easily with no effort. Because my code is written really understandable, I'd like to hide the main principles I used at the first place.
如果有人真的想了解我所做的一切,他会的.我知道.
If someone really wants to understand what I have done, he will. I know that.
那么有没有一种常用的方法可以对python代码进行简单的保护?
So is there a common method you use to make a simple protection for python code?
推荐答案只需使用this answer中的方法将其编译为字节码.
import py_compile py_compilepile("file.py")pyc 文件可以代替 py 文件分发.
The pyc file can be distributed in place of the py file.
更多推荐
对非程序员隐藏 Python 代码
发布评论