Python script header

后端 未结 6 1914
名媛妹妹
名媛妹妹 2020-12-04 10:54

The typical header should be

#!/usr/bin/env python

But I found below also works when executing the script like $python ./my_script.p

6条回答
  •  不知归路
    2020-12-04 11:04

    The Python executable might be installed at a location other than /usr/bin, but env is nearly always present in that location so using /usr/bin/envis more portable.

提交回复
热议问题