#!/usr/bin/env python vs. #!/usr/bin/python
Ethan Furman
efurman at admailinc.com
Tue May 6 12:36:40 EDT 2008
Banibrata Dutta wrote:
>On 5/6/08, andrej.panjkov at climatechange.qld.gov.au
><andrej.panjkov at climatechange.qld.gov.au> wrote:
>
>
>>At our site we run IRIX, UNICOS, Solaris, Tru64, Linux, cygwin and
>>other unixy OSes.
>>
>>We have python installed in a number of different places:
>>/bin/python
>>/usr/local/bin/python
>>/usr/bin/python
>>/opt/freeware/Python/Python-2.5.1/bin/python
>>~mataap/platform/python/python-2.5.1
>>
>>So I cannot assume a single location for python. Nor for any other
>>tool, really. Bash for example. It may indeed be in /usr/bin on many
>>systems, on many others it is not.
>>
>>Note the version specific install points. This allows us to switch
>>over easily to different versions, and keep older versions in case
>>they are needed. We can test new versions before cutting over to them
>>operationally. (This matters for tools that are still changing, like
>>python or bash.)
>>
>>We use the very handy 'modules' package (not python modules, not
>>fortran modules) to adjust our paths and environment variables as
>>needed.
>>
>>Some of the install points are determined by policy, or historical
>>constraints, or hardware limits, or file system layout.
>>
>>Now it is true that it is easy to edit a single script to change the
>>hashbang line. It is not easy to change several hundred scripts, on
>>different machines. It is easy to adjust the environment to point to
>>the right python path, and have all your scripts pick it up
>>automatically.
>>
>>
>
>Looks reasonable thing to do...
>
>
>
>>Use /usr/bin/env. If env is not in /usr/bin, put a link to it there.
>>
>>
>
>So why not put symlink to Python over there on all machines, if we can
>put one (or env itself) there ?
>
A symlink directly to python (or whatever) would not help when testing
version x.y.z, while still leaving version a.b.c in place for the other
tools/scripts/programs to keep using.
--
Ethan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080506/e4144e9f/attachment-0001.html>
More information about the Python-list
mailing list