[Pythonmac-SIG] executing scripts on OS X

Jacob Kaplan-Moss jacobkm@cats.ucsc.edu
Mon, 9 Jul 2001 12:11:21 +0100


At 7:50 PM +0900 7/9/01, parks  kevin wrote:
[snip]
>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.


Try:

% ./hello.py

Why?

Under a *nix, you've got to give a full path for any command.  So if 
the file "hello.py" is in a directory that you have in your PATH 
(i.e. /usr/bin or something) it will work just fine, but since (I'm 
assuming) hello.py is not in your PATH, you need to tell the shell 
where that file is.

Hope that helps,

-j