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
Optimize the compiled program.
python -O path #path is the path
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