5

#!/usr/bin/env python vs #!/usr/local/bin/python

 2 years ago
source link: https://fann.im/blog/2010/09/16/usr-bin-env-python-vs-usr-local-bin-python/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

#!/usr/bin/env python vs #!/usr/local/bin/python

Sep 16, 2010

#!/usr/bin/env python

Will figure out the correct location of python and make that as the interpreter for rest of the script.

#!/usr/local/bin/python

Pointing to python is located at /usr/local/bin/python.

简单说 /env python 就是查找系统环境变量中的 python 并默认选择 path 里第一个。/usr/local/bin/python 就是指定使用这个路径下的 python,可能不同机子不同环境下 python 位置稍有差别,就有可能 /usr/local/bin/python 不存在。

via Here

Was this page helpful?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK