Why use #!/usr/bin/env python rather than #!python?

Adriano Ferreira a.r.ferreira at gmail.com
Fri Dec 2 10:33:25 EST 2005


On 12/2/05, Klaus Alexander Seistrup <klaus at seistrup.dk> wrote:
> /me is using bash on linux.

I think that was not a bash issue in my case, but a Cygwin/Win32
issue. Windows has some monstruous oddities in order to assure broken
behavior of yesterday is here today in the name of compatibility.
Examples of these everlasting broken behaviors in Windows are looking
at current directory and path no matter what you say. Cygwin isn't
immune to this.

> According to <http://www.in-ulm.de/~mascheck/various/shebang/>:
>
>   »However, env(1) is not /usr/bin/env but /bin/env at least on
>    Unicos 9.0.2, OpenServer 5.0.6 and IIRC on at least one older
>    Linux distribution. Free-, Net- and OpenBSD in turn only come
>    with /usr/bin/env. So the env-mechanism is increasing conven-
>    ience, but not strictly assuring portability.«

That is to the point. Thanks.

Adriano.



More information about the Python-list mailing list