Skip to content

Instantly share code, notes, and snippets.

@zhuzhuor
Created March 26, 2012 04:02
Show Gist options
  • Save zhuzhuor/2202876 to your computer and use it in GitHub Desktop.
Save zhuzhuor/2202876 to your computer and use it in GitHub Desktop.
to assist you for drawsome...
#!/usr/bin/env python
chars = 'defillmorsty'
w_len = 7
assert len(chars) == 12
import enchant
d = enchant.Dict('en_US')
from itertools import permutations
s = set()
l = permutations(chars, w_len)
for i in l:
w = ''.join(i)
if w not in s and d.check(w):
s.add(w)
print w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment