osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to achieve pyc only deployment for module in python3.6


dieter <dieter at handshake.de> writes:
> Chandana Pattanayak <chandana.pattanayak at patterneffectslabs.com> writes:
>> I have a requirement to provide basic code protection for a module in our
>> product suite. With python 3.6 the .pyc files are created under pycache ,
>> so if i remove the py file the module is not found anymore.
> ...
> Note that you can disassemble "*.pyc" files and gain
> quite some insight by this. Thus, the protection provided
> by not deploying the source files is basic indeed.

You should also read "https://www.python.org/dev/peps/pep-3147/";.
It mainly explains why "pycache" has been introduced
but as a side effect, it points out a bondage between
the "*.pyc" files and the major Python version: it is very likely,
that a major Python version will not accept "*.pyc" files created
by another major Python version.