[Pythonmac-SIG] Re: executing scripts on OS X

parks kevin kp87@lycos.com
Tue, 10 Jul 2001 03:50:29 +0900


I created a dir called ~/scripts. I stuck my little hello.py file:


#!/usr/bin/env python
print "hello, fool!"


Now the python binary is in my path already.

i added the scripts folder to my path (by adding my ~/Library/init/tcsh/path file and putting in that file:

setenv PATH "$PATH ~/scripts:~/apps"

if i type in my prompt setenv, it dumps my env settings and i can see /usr/local/bin
and all the usual paths, plus th paths i have added: ~/scripts:~/apps. I stuck a binary in there just as a sanity check so my path is 100% good to go.

I go to my prompt and type

% cd ~/scripts
% hello.py


and guess what?! Nothing still command not found. If i type:

% ~/scripts/hello.py

It is ok.

So, what gives? I thought that there was no more set PYTHONPATH? So no matter what you do you must always give the full path to execute a script?

-kp--

At least i figured out how to ammend my path. Thanks to the help of MR. Barker


though i would still like to know why the full path is required despite the setenv path additions to the startups.




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