On Tue, May 24, 2011 at 9:10 AM, Hank Wilkinson <hwilkin...@triad.rr.com>wrote:
> I am trying to do script in python using "./" > Here is a session showing "bad interpreter: No such file or directory" > Is this a python question/problem? > > Last login: Sat May 21 14:22:49 on ttys000 > John-Wilkinsons-iMac:~ wilkinson$ cd > /Users/wilkinson/Documents/py32/p31summerfield > John-Wilkinsons-iMac:p31summerfield wilkinson$ pwd > /Users/wilkinson/Documents/py32/p31summerfield > John-Wilkinsons-iMac:p31summerfield wilkinson$ ls hello.py > hello.py > John-Wilkinsons-iMac:p31summerfield wilkinson$ python hello.py > Hello World! > John-Wilkinsons-iMac:p31summerfield wilkinson$ chmod +X hello.py > John-Wilkinsons-iMac:p31summerfield wilkinson$ ./hello.py > -bash: ./hello.py: /usr/local/bin/python3.1^M: bad interpreter: No such > file or directory > John-Wilkinsons-iMac:p31summerfield wilkinson$ echo $PATH > > /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin > John-Wilkinsons-iMac:p31summerfield wilkinson$ cat hello.py > #!/usr/local/bin/python3.1 > > print("Hello", "World!") > John-Wilkinsons-iMac:p31summerfield wilkinson$ python > Python 3.1.2 (r312:79147, Mar 20 2011, 17:15:01) > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import sys > >>> sys.path > ['', > '/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python31.zip', > '/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1', > '/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/plat-darwin', > '/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib-dynload', > '/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages'] > > Thank you. > Hank > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > do you have this in first line of your file: #!/usr/bin/env python in your path you have /usr/bin. if you go there you will probably see a directory with python executable in it. -- Joel Goldstick
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor