On Fri, 28 Sep 2012 06:57:28 -0400 Roy Smith <r...@panix.com> wrote: > > I've seen both shebang lines to run a Python script on a *nix host: > > > > #!/usr/bin/env python > > #!/usr/bin/python > > > > What's the difference? > > The first one looks through your PATH to find the right python > interpreter to run. The second one is hard-wired to run /usr/bin/python. > > If you only have a single copy of python installed, it doesn't really > matter which you use. But, you might as well get into the habit of > using the /usr/bin/env flavor because it's more flexible.
Not just flexible but portable. On various systems I have Python in /usr/bin, /usr/local/bin and /usr/pkg/bin. "#!/usr/bin/env python" finds it in each case so I only need one version of the script. -- D'Arcy J.M. Cain <da...@druid.net> | Democracy is three wolves http://www.druid.net/darcy/ | and a sheep voting on +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner. IM: da...@vex.net -- http://mail.python.org/mailman/listinfo/python-list