python, create a filtered list from a text document
<p>Every time I try to run this program, Python IDLE responds by telling me that it is not responding and has to close. Any suggestions on how to improve this code to make it work the way I want?</p>

<pre><code>#open text document
#filter out words in the document by appending to an empty list
#get rid of words that show up more than once
#get rid of words that aren't all lowercase
#get rid of words that end in substring 'xx'
#get rid of words that are less than 5 characters
#print list

fin = open('example.txt')
L = []
for word in fin:
    if len(word) &gt;= 5:
        L.append(word)
    if word != word:
        L.append(word)
    if word[-2:-1] != 'xx':
        L.append(word)
    if word == word.lower():
        L.append(word)
print L
</code></pre>
