Hey,<br><br>first of all: sorry for the 100% n00b question<br>i`m brand new to python and i seem to start off with the biggest problem of all.. not even getting python to work.<br>i`m running Fedora core 7 test 2 and all the python based applications are working fine (like pirut, pipet, and some other yum related tools)
<br><br>but when i try to run this script:<br><pre>#!/usr/bin/python<br>#<br># python script tel.py<br># gevonden door Jan Mooij 24 september 2000<br>#<br>from sys import *<br>from string import *<br><br>     # Create an empty dictionary.
<br>count = {}<br><br>for line in open(argv[1], 'r').readlines():<br>    for word in split(line):<br>        if count.has_key(word):<br>            count[word] = count[word] + 1<br>        else:<br>            count[word] = 1
<br>words = count.keys()<br>words.sort()<br>for word in words:<br>    print "%15s\t%10d" % (word, count[word])<br><br><font size="4"><br></font><font style="font-family: arial,sans-serif;" size="4">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<br>now this is the error that i get:<br><br>Traceback (most recent call last):<br>
  File "./tel.py", line 12, in <module><br>    for line in open(argv[1], 'r').readlines():<br>IndexError: list index out of range<br><br>also i`m not even getting the most simple sample code to work.. "Hello World".
<br>everything works fine when i first enter the python console by typing python. than i have the  >>> things<br>than print "Hello World" gives me the expected result but that`s not what i want.. i want to do it from a file..
<br><br>the solution is probable extremely simple but i have no idea as a complete n00b in python. i do have alot php experience.<br>hope someone could help me out with this.<br><br>o and any function that i use in python gives me "command not found: print/whatever function i use"
<br>(probable just a simple yum install command that i need to do to get this working.. just try to figure that out with no python knowledge)<br><br>Thanx alot in favor.<br></font></pre>