[Tutor] "#!/usr/bin/env python" vs "#!/usr/local/bin/python"

Scott Oertel freebsd at scottevil.com
Fri Jun 22 16:12:34 CEST 2007


emilia12 at mail.bg wrote:
> hi list,
>
> how to choose between "#!/usr/bin/env python" and
> "#!/usr/local/bin/python" in the beginning of the script ?
> e.
>
>
>
> -----------------------------
>
> SCENA - Ĺäčíńňâĺíîňî ÁĹÇĎËŔŇÍÎ ńďčńŕíčĺ çŕ ěîáčëíč ęîěóíčęŕöčč č ňĺőíîëîăčč.
> http://www.bgscena.com/
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>   

One of the main dis-advantages to using '/usr/bin/env python' is that
you have to either A) make sure the environment is initialized, or B) 
initialize the environment  manually before executing the script.  If
you, for example, want to use a python script at boot time, before the
environment is initialized, i strongly recommend using an absolute path.


-Scott Oertel



More information about the Tutor mailing list