IMHO, writing
python /path/to/script.py
Absolutely wrong, especially these days. Which python? python2.6? 2.7? 3.0? 3.1? In most cases, you need to specify the python version in the shebang tag of the python file. I recommend using
#! / usr / bin / env python2 #or python2.6 or python3 or even python3.1
for compatibility.
In this case, it is much better to have a script executable and call it directly:
#! / bin / bash
/path/to/script.py
Thus, you only need the python version in one file. Most systems currently have python2 and python3, and it happens that symlink python points to python3 , while most people expect it to point to python2 .
Enrico Carlesso Dec 07 '10 at 15:08 2010-12-07 15:08
source share