On 26 July 2013 20:32, Barry Warsaw <ba...@python.org> wrote:

> I love `#!/usr/bin/env python` *for development* but I really think its a
> bad
> thing to have for installed scripts.  Certainly, for distro installed
> scripts,
> it's (usually) terrible.  I think virtualenv installs are generally in the
> same boat though - if you're installing a script into a virtualenv, it's
> better to rewrite the shebang to use the executable that was used to
> install
> it.
>

There are cases where it's useful and appropriate - the best example "in
the wild" is distil, which uses #!/usr/bin/env python to allow it to run
with "the current Python" specifically, so that it can be used to install
packages whatever Python you're using and without needing multiple copies
of the script installed. I've written similar types of scripts which
benefit in the same way from a /user/bin/env shebang line.

In fact, support for /usr/bin/env was added to the Windows launcher just
recently to provide precisely this functionality for scripts on Windows.

Paul
_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to