559 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
|Playing Wordle in Python|
|A modest Python program to mimic the popular online Wordle game, using a Tkinter form and some basic classes.|
I think the game works, but I haven't tested it exhaustively. The opportunity to share your results will be in version 2 of the software!
Here's what a typical screen looks like:
The word was DEMUR on this occasion, if you're wondering.
To make the game easy to run, I haven't used any external modules - just these:
The only modules used by this Wordle program.
I've also included all of the code in a single file, which you can download here. This also includes these two text files:
|words.txt||A list of all the 12,973 valid five-letter words that you can guess in Wordle.|
|targets.txt||A list of the 2,315 possible words you might have to guess.|
You'll need to set the path to where these files are on your computer at the start of the program wordle.py:
Make sure you change this file path.
You can run the program as normal in Python:
Click on the letters that you want to try. Use BACK to change a letter, and ENTER when you have a valid five-letter word.
Each time that you run the program it will pick a new random word from the appropriate text file.
The program uses TKinter for its graphical interface, a Python module I neither know particularly well nor love (this probably shows with the slightly clunky way I draw the buttons). I've used two classes:
|Button||Hold each of the letter buttons in the keyboard|
|Letter||Used to hold each of the letters in the 6 rows at the top.|
I've also added a fair few additional properties/attributes to the TKinter.Tk fom class.
I had fun creating this, although suspect I haven't quite ironed out all of the bugs. Let me know your thoughts!
25 Aytoun Street