python first-line comments

#! / usr / bin / env python3 
indicates that the file is a .py program, when executed python environment needs to perform.
This rule is a scripting language commonly observed:! When the first acts of # / usr / local / bin / python3 when designated for carrying out the script interpreter.
Note: 
1, must be the first line of the file
2, must begin with #, you lost an exclamation point!
3, / usr / local / bin / python3 is the full path name of the script interpreter.
And sometimes less clear script interpreter specific full path name; or development environment and runtime environment of different installation path. To ensure compatibility, you can also write: 
# / usr / bin / env python3!
Will automatically search for the script interpreter run time so absolute path 
python file to start the first line "#!", Said the implementation of some special command, usually used when "on a Unix, Linux, or Unix-like system use Python" .
# - * - coding: utf-  8 - * -  indicate the encoding format, mainly used to display Chinese, mainly used in python2

Guess you like

Origin www.cnblogs.com/ligq/p/11028427.html