crosswords helper program
pas at despam
Wed Oct 12 22:16:47 CEST 2005
Chris F.A. Johnson a écrit :
> On 2005-10-12, gg wrote:
>>I plan to write a program in Python in order to help me doing
>>crosswords, I was wondering if such a program already existed.
>>Basically it will get the number of letters of the word (5, 10, 12...)
>>then the letters known (B in second letter, E in 5th letter...) and then
>>search in a dictionary the words matching this criteria
> import os
> pattern = "B...E.."
> wordfile = "/usr/share/dict/words"
> cmd = "grep -i '\<" + pattern + "\>' " + wordfile
> os.system( cmd )
thanks to all, that should do the trick
More information about the Python-list