problem with lists
python-list at hendel.net
Wed Sep 11 17:54:23 EDT 2002
I want to create a list of domains, every domain only once.
So long I did the following, but it didn't work:
import sys, string, re
inputfile = open(sys.argv[-1], "r")
lines = inputfile.readlines()
lines = lines[3:]
for line in lines:
line = string.strip(line)[1:-1]
fields = string.split(line, "|")
domains = 
if not domains.index(fields[3:4]):
This brings the following error message:
[No write since last change]
Traceback (most recent call last):
File "./pop3create.py", line 22, in ?
ValueError: list.index(x): x not in list
Can someone explain this to me?
Immature love says, "I love you because I need you." Mature love says, "I need
you because I love you."
More information about the Python-list