[Pythonmac-SIG] executing scripts on OS X

parks kevin kp87@lycos.com
Mon, 09 Jul 2001 19:50:02 +0900


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

but no go! Is there a Python env variable or something that needs to be set or a path modification that i have missed?

obviously python is on my path since i can get the interpreter.

Sorry about this, I used to have a NeXT machine (*sigh*) and haven't used UNIX since then. Much is the same, But almost as much is different. tcsh i wildly different. I don't understand the new system of startup files. in the old days you had .login .logout and .tcshrc. Now there is a boat load of start-up files in a global + user muckable system, with links and pointers everywhere. Add to this mess that Apple (Unlike NeXT) treats us like babies and only allows us to muck with invisibles via the shell. (open -a TextEdit foo.py never works for me for some reason) and wouldn't you know it the csh/vi part of my brain has been accidentally erased.

cheers,
-kevin





Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/