Python basic study notes

The first line of the scripting language is to point out what executable program you want the code in your file to use to run it, it's that simple.

#!/usr/bin/python  : It tells the operating system to call the python interpreter under /usr/bin when executing the script;

#!/usr/bin/env python (recommended): This usage is to prevent OS users from not having python installed in the default /usr/bin path. When the system sees this line, it will first look for the python installation path in the env settings, and then call the interpreter program under the corresponding path to complete the operation.

#!/usr/bin/python  is equivalent to writing the python path;

#!/usr/bin/env python  will go to the environment settings to find the python directory, this is recommended

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325517934&siteId=291194637