[Pythonmac-SIG] executing scripts on OS X
John W Baxter
jwblist@olympus.net
Mon, 9 Jul 2001 11:11:56 -0700
At 19:50 +0900 7/9/2001, parks kevin wrote:
>I am trying to get python going on my OS X partition. I was able to make a
>text file called hello.py and put in it the revolutionary and complex bit
>of code
>
>!#/usr/local/bin/python
>print "hello, fool!"
>
>
>Now when i did:
>
>% python hello.py
>
>everything was dandy.
>
>however i did the CHMOD bit to make the file executable and the tried
>sh-banging it
>
>% hello.py
>
>nothing. just hello.py: Command not found.
>i also tried :
>
>!#/usr/bin/python
>!#/usr/bin/env python
Two things:
1. I hope you mean #! not !#. And I think you do, because the latter
gives a traceback when I use
python hello.py
2. On my machine, python as a command is a link:
lrwxr-xr-x 1 root wheel 25 Jun 22 18:08 /usr/bin/python ->
/usr/local/bin/python.exe
which python
will give you a starting point.
This is a "straight" install of the regular Python distribution, not MacPython.
--John
--
John Baxter jwblist@olympus.net Port Ludlow, WA, USA