<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 6, 2013 at 1:04 AM, LubanWorks <span dir="ltr"><<a href="mailto:luban.works@gmail.com" target="_blank">luban.works@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br>My question is:<br><br>Why  when I use #!/home/luban/Linux/Python/2.7.3/bin/python at the beginning of myscript.py, <span style="color:rgb(51,51,255)"><b>./</b></span>myscript.py can work,<br>
<br>but if I use the wrapper  #!/home/luban/bin/python in my python script, <span style="color:rgb(51,51,255)">use <b>./</b> </span> to run the script, it cannot not work?<br></blockquote><div><br></div><div style>Your shell will be trying to run your python script. The reason being that when you do #!/bin/sh in the wrapper the shell tries to execute $0 which in this case is the name of your python script.</div>
<div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br>I had many scripts used #!/home/luban/bin/python when I only installed python  under #!/home/luban/ for Linux, they can run with ./, I don't want to change them,<br>

<br>so, how to let <span style="color:rgb(51,51,255)">./ </span>run the python script If I want to <span style="color:rgb(51,51,255)"><b>KEEP</b></span><span style="color:rgb(51,51,255)"></span> wrapper  #!/home/luban/bin/python as the shebang line? <br>

<br></blockquote><div><br></div><div style>Probably easier to use a symlink, or just use #!python and adjust your $PATH.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>Best Regards,<br>Luban<br>
<br>--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>"The UNIX system has a command, nice ... in order to be nice to the other users. Nobody ever uses it." - Andrew S. Tanenbaum</div>
</div></div>