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 )

-- 
    Chris F.A. Johnson                     <http://cfaj.freeshell.org>
    ==================================================================
    Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
    <http://www.torfree.net/~chris/books/cfaj/ssr.html>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to