Python - Efficiently working with large permutated lists -
i've written short anagram solver script in python 2.7 . #import permutations module itertools import permutations perm #defined functions def check(x,y): #opens dictionary file open('wordsen.txt') dictionary: '''checks permutations against of dictionary words , appends matching ones on of empty lists''' line in dictionary: in x: if + '\n' == line: y.append(i) #empty lists appended later anagram_perms = [] possible_words = [] #anagram user input anagram = list(raw_input("input scrambled word: ").lower()) #creates single list items permutations, deletes duplicates char in perm(anagram): anagram_perms.append("".join(char)) anagram_perms = list(set(anagram_perms)) #uses defined function check(anagram_perms, possible_words) #prints number of perms created, prints possible words beneath print len(anagram_perms) print '\n...