3 ways to encrypt Python files

pyc

A binary file is a file generated after the py file is compiled. It is a byte code. After the py file becomes a pyc file, the loading speed is improved, and pyc is a cross-platform byte code. It is executed by the Python virtual machine, which is similar to the concept of the Java or .NET virtual machine.

import py_compile
py_compile.compile('path') #path is the path

pyo

Optimize the compiled program.

python -O path #path is the path

pyd

Dynamic link library.

pip install cython
pip install easycython
easycython path #path is the path

When renaming here, remove ".cp35-win_amd64" and do not change the previous name, otherwise it will not be quoted normally. import main #Make sure that there is no .py or .pyc in the current folder.

The pyc, pyo, and pyd generated by different versions cannot be executed in other versions.

Recommended Posts

3 ways to encrypt Python files
What are the ways to open files in python
How to delete cache files in python
How to save text files in python
01. Introduction to Python
Python renames files
Python example method to open music files
Introduction to Python
Implementation of Python headless crawler to download files
How to read and write files with Python
How does Python store data to json files
Centos 6.4 python 2.6 upgrade to 2.7
Centos 6.4 python 2.6 upgrade to 2.7
Python implements FTP to upload files in a loop
Centos default python2.6 upgrade to
Solution to python alignment error
CentOS upgrade python2 to pyth
Python code to find bugs (2)
Python code to find bugs(7)
How to comment python code
Python analysis of wav files
Python code to find bugs(4)
Python code to find bugs (3)
Python code to find bugs(9)
Python reads files by line
How to learn python quickly
How to uninstall python plugin
Introduction to Python related modules
Python code to find bugs(6)
python batch run py files
Python code to find bugs (1)
Python code to find bugs(8)
How to understand python objects
Python code to find bugs(5)
How to use python tuples
Python| function using recursion to solve
Method steps to increase python font
python how to view webpage code
How to use python thread pool
Use python to query Oracle database
python ftp upload files and folders
Use C++ to write Python3 extensions
How to write python configuration file
Python novice learns to raise usage
Use python to achieve stepwise regression
How to save the python program
Python implements 126 mailboxes to send mail
Using Python to implement multiple clipboards
Talking about php calling python files
How to omit parentheses in Python
How to install Python 3.8 on CentOS 8
Python example to calculate IV value
How to write classes in python
How to filter numbers in python
Centos6.7 comes with python upgrade to
How to read Excel in Python
How to install Python on CentOS 8
How to solve python dict garbled
How to view errors in python
Python from entry to proficiency (2): Introduction to Python
Steps to enter python through cmd