lower() and searching for a word in a file using a list
<p>So what I'd like to do is to make all the lines lowercase and then use my part_list to search for all words matching in frys.txt and to append it to items. I'm having a lot of trouble creating a loop that goes through each word in the list and just actually finding the words in frys.txt. I'm even trying to find doubles if that is at all possible. But the main thing I want to be able to do is just find that the word exists and to append it to items if it does. </p>

<p>Any suggestions would be great!</p>

<pre><code>items = []
part_list = ['ccs', 'fcex', '8-12', '8-15', '8-15b', '80ha3']
f = open("C:/Users/SilenX/Desktop/python/frys.txt", "r+")
searchlines = f.readlines()
f.close()

for n, line in enumerate(searchlines):
    p = 0
    if part_list[p] in line.split():
        part_list[p] = part_list[p + 1]
        parts = searchlines[n]
        parts = parts.strip('\n')
        items.append(parts)

print items
</code></pre>
