Getting Python scripts to execute in RedHat

Pythor pythor at gmail.com
Fri Jun 23 18:45:54 CEST 2006


I apologise if this is a stupid newbie error, but I've been googling
"hash bang" and "shebang" all morning.  I've added the shebang to my
scripts:

#!/usr/bin/python

I've added execute permissions:

chmod +rx shebang.py

But I still can't execute my scripts by themselves

shebang.py  ## produces error

python shebang.py  ## runs correctly

I found one site that mentioned adding "./" to the beginning, and that
works.

./shebang.py  ## runs correctly.

I gather that there's a path problem then.  My script is in
~/pyscripts/.  How do I get my scripts to run without using "./"?




More information about the Python-list mailing list