I'm working on python and, trying very simple codes, the answer is always the same: main (sys.argv) Index error: list index out of range.
This is my code:
import sys import codecs def main (file1): fileInput = codecs.open(file1, "r", "utf-8") raw = fileInput.read() rawS = raw.split() for parola in rawS: print "parola:", parola.encode("utf-8") main(sys.argv)
and the file.txt is like this:
andiamo 3 45 andare 5 47
anybody knows what is wrong with my code?
Thank you so much,