12
For a Python script to be executable on a Linux/Unix-based operating system, it must start with the designated shebang (#!
):
#! /usr/bin/env python
But followed by the same I have seen used two different instructions:
#! /usr/bin/env python
and
#! /usr/bin/python
This leaves a bit of confusion between both methods to declare the file as a script, and the disambiguation of this subject seems relevant to the production of more compatible and universally accepted code.
What are the differences between the methods mentioned, their advantages and disadvantages, in an attempt to determine which one should be used?