There are 3 types of Python files: source code files, compiled files, optimized files.
Source code files: Files that end with ". Py" for code saved for the development program.
Compile file: The file ends with ". PYc", assuming that the source file is 1.py, if 1.py is compiled to 1.PYC, enter the following code in 2.py:
#!/usr/bin/python3import py_compilepy_compile.compile (' 1.py ')
Then on the command line:
Can. Since I am using the enve virtual environment, the compiled PYC file is under the __python__ folder.
Optimized code: Optimized source file with extension ". Pyo", Python-o-M py_compile 1.py.
The code that is compiled and optimized executes faster than the source file interpretation, and when necessary, the source code can be compiled or optimized for execution.
Generally in the development process, with. PY development will be easy to debug, development.
File types in Python