Variations on a theme by "pound bang"
Skip Montanaro
skip at mojam.com
Mon Jun 14 08:28:27 EDT 1999
on the merits of "#!/usr/bin/env python" vs. "#!/usr/bin/python", jam
wrote:
> the first one is more generic, and independent of the actual location of the
> command in question (in this case, the python interpreter).
There is one situation where the second form is preferred. If you are
invoking a script in an environment where your normal PATH-setting
mechanisms haven't been executed and you're running with a default PATH,
you may find that "/usr/bin/env python" either finds no interpreter or
finds the wrong one. In that case, you need to hard-code the path to
the program you want to execute. This often happens with CGI scripts or
scripts that are executed via rsh/ssh.
--
Skip Montanaro | Mojam: "Uniting the World of Music"
http://www.mojam.com/
skip at mojam.com | Musi-Cal: http://www.musi-cal.com/
518-372-5583
More information about the Python-list
mailing list