For a Python script to be run on a Linux / Unix-based operating system, it should start with the designated shebang ( #!
):
#! /usr/bin/env python
But followed by the same I've seen two different instructions used:
#! /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 producing more compatible and universally accepted code.
What are the differences between the stated methods, their advantages and disadvantages, in an attempt to determine which should be used?