crosswords helper program

Chris F.A. Johnson cfajohnson at gmail.com
Wed Oct 12 09:50:31 EDT 2005


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>



More information about the Python-list mailing list