How To Unscramble Software Codes

P: 27
Hi, I'm new to Python and need some help with this program. I'm trying to take 10 jumbled words at a time and have the program unscramble them and then print them out like: word1,word2,word3, etc.
So far the code will unscramble more than one word at once but it will print the answer several times if there is more than 1 of the same letter in the word and it will print them in a column. Example is inwdwo and garnama (window anagram). It will print them like this:
window
window
anagram
anagram
anagram.
I read that a set can help this but I'm not sure where to put that or how to get the %s,%s,%s type of print out. Any help?
  1. import string
  2. def anagrams(s):
  3. if s ':
  4. return [s]
  5. else:
  6. ans = []
  7. for an in anagrams(s[1:]):
  8. for pos in range(len(an)+1):
  9. ans.append(an[:pos]+s[0]+an[pos:])
  10. return ans
  11. def dictionary(wordlist):
  12. dict = {}
  13. infile = open(wordlist, 'r')
  14. for line in infile:
  15. word = line.split('n')[0]
  16. dict[word] = 1
  17. infile.close()
  18. return dict
  19. def main():
  20. anagram = raw_input('Please enter words: ')
  21. wordLst = anagram.split(None)
  22. diction = dictionary('wordlist.txt')
  23. for word in wordLst:
  24. anaLst = anagrams(word)
  25. for ana in anaLst:
  26. if diction.has_key(ana):
  27. diction[ana] = word
  28. print ' ', ana
  29. main()
Unscramble

A love supreme john coltrane pdf editor online. Dvb tv channels unscramble software free download. MOIPro MOI Pro is a Linux based IP streamer with two PCI-E slot, it enables you to receive satellite TV cha.