Why is '#!/usr/bin/env python' supposedly more correct than just '#!/usr/bin/python'?

后端 未结 5 2089
悲哀的现实
悲哀的现实 2020-12-12 20:34

Anyone know this? I\'ve never been able to find an answer.

5条回答
  •  北海茫月
    2020-12-12 21:02

    it finds the python executable in your environment and uses that. it's more portable because python may not always be in /usr/bin/python. env is always located in /usr/bin.

提交回复
热议问题