First, note:
1. Single-line Comment
# content being commented on
2, multi-line Comment
"""
Content being commented on
"""
Second, the module
When we are programming, we tend to be a master. py file, multiple feature files that are imported into the main file when a feature is used
These feature files end in. py, which we can call modules
Modules are divided into system modules and custom modules
System module is in the system itself, like SYS, time and other modules
and the custom module is what we wrote. py file
Import module with import+ module name, example:
Import Sys
At runtime, the import SYS line will be replaced with the corresponding function
Three, byte code
When we execute the Import function file in the main file, we find that there is a file with the same name as the. PYc in the disk, and this. pyc file is a byte-code
We know that Python is running: Python---machine code--Computer
If there is a direct byte code, it will improve the efficiency of python, because the process of converting code into bytecode is eliminated.
The system will first look for the. pyc file, in other words, if there is a. py file, but there are. pyc files that can be run as programs
003dayPython Learning initial module and byte code