need to get an index for an item in a list

nephish at xit.net nephish at xit.net
Sun Jul 3 15:15:38 EDT 2005


hey there,
i need to be able to get the index for an item in a list.
the list is a list of lines read from a text file.

like this:

file = open("/home/somefile.text", "r")
lines = file.readlines()
file.close()

now, i want to see if a certain string is == to one of the lines
and if so, i need to know the index of that line.

any ideas?

thanks




More information about the Python-list mailing list