i can`t get python working on the command line (linux)
facundo at taniquetil.com.ar
Wed Mar 14 13:54:38 CET 2007
> and i`ve put it in tel.py (just the same as in the sample) than chmod
> it to 777 (just to make sure it isn`t a permission issue) and than i
> run it with: ./tel.py
> now this is the error that i get:
> Traceback (most recent call last):
> File "./tel.py", line 12, in <module>
> for line in open(argv, 'r').readlines():
> IndexError: list index out of range
Your Python is installed fine.
The problem is that you're accesing argv, which would be the first
argument after the program in the command line, and you're executing
your program without any parameters.
All you need to do is read the error message, they help, ;)
Try executing your program with something like
where, of course, myfile.txt is some file you have around...
More information about the Python-list