Python execution method:
Entering Python on the Linux command line will enter the Python interactive environment, where you can enter a command or function for the Python language, such as exit () for exiting the interactive environment, ID () to see where the value referenced by the variable is stored in memory,
Open a document with the Vim editor and enter #! in the first line /usr/bin/python, followed by the Python language, after saving the exit, add x permissions, can be used absolute path execution, or use the Python command plus the file name, at this time without the first line in the file input #! /usr/bin/python
Python file:
file.py: Source code form file, open can see the source code, easy to modify
FILE.PYC byte code files, compiled files, execute more efficiently, generate method: Open a file
Input
Import Py_compile
Py_compile.compile (' file.py ')
3.file.pyo optimized code file, also compiled, method: Linux command line input python-o-M py_compile file.py
Python Learning notes-1