<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-2">
<META content="MSHTML 6.00.2900.3086" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff size=2>Okay,
I guess, people are missing points here. </FONT></SPAN></DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff size=2>When
do you</FONT></SPAN></DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff
size=2><STRONG>#!/usr/local/bin/python</STRONG></FONT></SPAN></DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff size=2>You
are specifying the location to the python executable in your machine, that rest
of the script needs to be interpreted with.</FONT></SPAN></DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff size=2>You
are pointing to python is located at
/usr/local/bin/python</FONT></SPAN></DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff
size=2>Consider the possiblities that in a different machine, python may be
installed at /usr/bin/python or /bin/python in those cases, the above #! will
fail.</FONT></SPAN></DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff size=2>For
those cases, we get to call the env executable with argument which will
determine the arguments path by searching in the $PATH and use it
correctly.</FONT></SPAN></DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff
size=2>Thus,</FONT></SPAN></DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff
size=2><STRONG>#/usr/bin/env python</STRONG></FONT></SPAN></DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff size=2>Will
figure out the correct location of python ( /usr/bin/python or /bin/python from
$PATH) and make that as the interpreter for rest of the
script.</FONT></SPAN></DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff size=2>- (
env is almost always located in /usr/bin/ so one need not worry what is env is
not present at /usr/bin)</FONT></SPAN></DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff size=2>Hope
this helps.</FONT></SPAN></DIV>
<DIV><SPAN class=539371914-14062007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV align=left><FONT face=Arial size=2>-- </FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Senthil</FONT></DIV><BR><BR>The price of
seeking to force our beliefs on others is that someday they might force their
beliefs on us. -- Mario Cuomo
<DIV> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> tutor-bounces@python.org
[mailto:tutor-bounces@python.org] <B>On Behalf Of </B>David
Duncan<BR><B>Sent:</B> Thursday, June 14, 2007 19:44<BR><B>To:</B>
tutor@python.org<BR><B>Subject:</B> Re: [Tutor] "#!/usr/bin/env python" vs
"#!/usr/local/bin/python"<BR></FONT><BR></DIV>
<DIV></DIV><BR><BR>
<DIV><SPAN class=gmail_quote>On 6/14/07, <B class=gmail_sendername>Ezra
Taylor</B> <<A
href="mailto:ezra.taylor@gmail.com">ezra.taylor@gmail.com</A>> wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">I
think Emilia means what's the difference. From what little I know,
#!/usr/bin/env python will choose the first python that's in your path.
Were as the second option, you explicitly choose which instance of python you
want. I'm using using python from Activestate. So my shebang is to
the Activestate directory for python. If I'm wrong, please correct.
<BR><BR>Ezra
<DIV><SPAN class=e id=q_1132a87ba2f4b39c_1><BR><BR>
<DIV><SPAN class=gmail_quote>On 6/14/07, <B class=gmail_sendername><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:emilia12@mail.bg" target=_blank>emilia12@mail.bg</A></B> <<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:emilia12@mail.bg" target=_blank>emilia12@mail.bg</A>>
wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">hi
list,<BR><BR>how to choose between "#!/usr/bin/env python"
and<BR>"#!/usr/local/bin/python" in the beginning of the script ?
<BR>e.<BR><BR><BR><BR>-----------------------------<BR><BR>SCENA -
Единственото БЕЗПЛАТНО списание за мобилни комуникации и технологии.<BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://www.bgscena.com/"
target=_blank>http://www.bgscena.com/</A><BR><BR>_______________________________________________
<BR>Tutor maillist - <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Tutor@python.org" target=_blank>Tutor@python.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://mail.python.org/mailman/listinfo/tutor"
target=_blank>http://mail.python.org/mailman/listinfo/tutor</A><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR></SPAN></DIV>-- <BR><SPAN class=sg>Ezra Taylor
</SPAN><BR>_______________________________________________<BR>Tutor maillist
- <A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Tutor@python.org">Tutor@python.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://mail.python.org/mailman/listinfo/tutor"
target=_blank>http://mail.python.org/mailman/listinfo/tutor</A><BR><BR></BLOCKQUOTE></DIV><BR>The
real difference here is that by using the "env" command, you have the
option to input many different settings preferences before calling the python of
your choice. The statement above, is a very simple choice of the python
based upon the current environment, but it could be augmented very easily.
<BR><BR>I suggest that you check out the man page for the command "env".
<BR clear=all><BR>-- <BR>David Duncan<BR><BR>Registered Linux User #279425<BR><A
href="http://counter.li.org">http://counter.li.org</A> </BODY></HTML>