<br><br><div class="gmail_quote">On Tue, May 24, 2011 at 9:10 AM, Hank Wilkinson <span dir="ltr">&lt;<a href="mailto:hwilkinson@triad.rr.com">hwilkinson@triad.rr.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I am trying to do script in python using &quot;./&quot;<br>
Here is a session showing &quot;bad interpreter: No such file or directory&quot;<br>
Is this a python question/problem?<br>
<br>
Last login: Sat May 21 14:22:49 on ttys000<br>
John-Wilkinsons-iMac:~ wilkinson$ cd /Users/wilkinson/Documents/py32/p31summerfield<br>
John-Wilkinsons-iMac:p31summerfield wilkinson$ pwd<br>
/Users/wilkinson/Documents/py32/p31summerfield<br>
John-Wilkinsons-iMac:p31summerfield wilkinson$ ls hello.py<br>
hello.py<br>
John-Wilkinsons-iMac:p31summerfield wilkinson$ python hello.py<br>
Hello World!<br>
John-Wilkinsons-iMac:p31summerfield wilkinson$ chmod +X hello.py<br>
John-Wilkinsons-iMac:p31summerfield wilkinson$ ./hello.py<br>
-bash: ./hello.py: /usr/local/bin/python3.1^M: bad interpreter: No such file or directory<br>
John-Wilkinsons-iMac:p31summerfield wilkinson$ echo $PATH<br>
/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin<br>
John-Wilkinsons-iMac:p31summerfield wilkinson$ cat hello.py<br>
#!/usr/local/bin/python3.1<br>
<br>
print(&quot;Hello&quot;, &quot;World!&quot;)<br>
John-Wilkinsons-iMac:p31summerfield wilkinson$ python<br>
Python 3.1.2 (r312:79147, Mar 20 2011, 17:15:01)<br>
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin<br>
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<br>
&gt;&gt;&gt; import sys<br>
&gt;&gt;&gt; sys.path<br>
[&#39;&#39;, &#39;/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python31.zip&#39;, &#39;/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1&#39;, &#39;/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/plat-darwin&#39;, &#39;/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib-dynload&#39;, &#39;/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages&#39;]<br>

<br>
Thank you.<br>
Hank<br>
<br>
_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</blockquote></div><br>do you have this in first line of your file:<br><br>#!/usr/bin/env python<br><br>in your path you have /usr/bin.  if you go there you will probably see a directory with python executable in it.<br>
<br><br><br clear="all"><br>-- <br>Joel Goldstick<br><br>