Getting Python scripts to execute in RedHat

Daniel Nogradi nogradi at
Fri Jun 23 19:47:39 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
> But I still can't execute my scripts by themselves
>  ## produces error
> python  ## runs correctly
> I found one site that mentioned adding "./" to the beginning, and that
> works.
> ./  ## 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 "./"?

Add ~/pyscripts to your path for example by putting this into your
.bash_profile if you are using bash:

export PATH


More information about the Python-list mailing list