LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I add python to the PATH... (http://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-add-python-to-the-path-713305/)

trist007 03-21-2009 03:09 AM

How do I add python to the PATH...
 
Python command is in /usr/bin and I have /usr/bin in my $PATH. I want to be able to run

./program.py

instead of having to do

python program.py

What do I need to do?

vindoan 03-21-2009 03:12 AM

Do you have the command directive on the first line of the python script?

#!/usr/bin/env python

Have you set the execute bit on the file?

chmod +x file.py

Cheers

trist007 03-21-2009 10:11 AM

Yes I have

#!/usr/bin/python

Yes I have the execute bit on

The program runs if I do

sudo python ./program.py

But I want to be able to do

sudo ./program.py


All times are GMT -5. The time now is 09:55 PM.