On 1/16/14 7:58 PM, Sam wrote:
I would like to protect my python source code. It need not be foolproof as long
as it adds inconvenience to pirates.
Is it possible to protect python source code by compiling it to .pyc or .pyo?
Does .pyo offer better protection?
First, .pyc and .pyo are nearly identical: they are bytecode. The only
difference is that .pyo has been "optimized", which in this case simply
means that the docstrings and asserts are gone. It is not difficult to
see what a Python program does by looking at the bytecode, and the
standard library includes the dis module for disassembling it.
How to protect your code depends an awful lot on what kinds of secrets
are in the code, and how valuable those secrets are, and therefore how
hard someone will work to get at them.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list