Re: executable python scripts

Tim O'Malley (timo@bbn.com)
21 Mar 1995 22:47:29 GMT

hola.

From: Guido.van.Rossum@cwi.nl
>
> > #!/data/maths/graham/APP/PYTHON/bin/python
> > print "a"
> >
> > Now when I run fred by doing say "./fred", I get the message
> > "./fred: Permission denied.".
>
> Some OS'es have a limit of 32 bytes on the pathname used here. Try a
> shorter path... (It may be a symbolic link I think.)

Yup, that is almost certainly it. One of the things that we commonly do
here is to put

#!/usr/bin/env python

as the first line of executable scripts. This results in the PATH
variable being used to find the executable. While this solution is a
wee bit slower (like might notice the extra microsecond), it works
across platforms and directory trees.

-- 
..................................................................
.                           .      Complex problems have         .
.   happy daze              .            simple,                 .
.        -tim O             .            easy-to-understand,     .
.                           .      wrong answers.                .
..................................................................