Python for Constructors

A python about to strike. Or perhaps code.

By popular demand — well, a few people requested — I recently updated the Sample Python scripts page. I modernized the old examples and added some new word list maintenance ideas.

Most constructors use tools like the Finder page to search for patterns for filling grids. You can discover more sophisticated patterns using Regular Expressions. RegEx is tricky to learn, so I created the Auto Finder page which generates these based on natural language descriptions.

But RegEx can’t do everything you might need. You can get much more out of your word lists with some simple Python scripts. Even if you’re not a programmer, you can copy and paste the samples and run them as is.

New samples

  • Sample 7 finds words that match a pattern of repeated letters. Enter abcabc and get MURMUR, TARTAR, and CANCAN.
  • Sample 8a compares two word lists — maybe an old and new version, or lists from completely different sources. The output is words only in list 1, only in list 2, and score differences between them.
  • Sample 8b tidies up a word list and writes a clean copy to a new file, merging duplicates and keeping the higher score. It can also be used to merge multiple lists into one.

You might have to modify these to do exactly what you want, but you have a great head start.

Note that all the samples use a shared word list reader function at the top of the page. The text explains.

Leave a comment

Your email address will not be published. Required fields are marked *