tags:

views:

61

answers:

3

Can anybody help me how to run a python script through command line?

My python script http://buffis.com/2007/07/25/getting-info_hash-for-xbt-tracker/comment-page-1/

I am using this command /var/www/hash_info.py /var/www/Muha_Album.7912.torrent

I have copied dependency file bencode.py mentioned in article link above. When I execute the above command I get error No such file or directory but when i chmod the file to 644 it says Permission denied the file is present at the location.

I have installed pythong using this command apt-get install python-gtk2 python-glade2

A: 

Try chmod 744

Joril
+3  A: 
python /var/www/hash_info.py /var/www/Muha_Album.7912.torrent
voyager
+2  A: 

Maybe it says:

bad interpreter: No such file or directory

Then, the first line, so called shebang line is the issue here. I guess you need to change it to where your python is really installed. On my Ubuntu installation it's /usr/bin/python.

Also, the solution from voyager should work for you as well.

Grzegorz Oledzki