Should I put #! (shebang) in Python scripts, and what form should it take?

前端 未结 12 1043
感动是毒
感动是毒 2020-11-22 01:27

Should I put the shebang in my Python scripts? In what form?

#!/usr/bin/env python 

or



        
12条回答
  •  借酒劲吻你
    2020-11-22 01:46

    You should add a shebang if the script is intended to be executable. You should also install the script with an installing software that modifies the shebang to something correct so it will work on the target platform. Examples of this is distutils and Distribute.

提交回复
热议问题