This tutorial walks you through how to make the classic Sudoku game as a GUI (Graphical User Interface) using Python’s built-in GUI library, tkinter.
We will be creating three main class objects, one for the Sudoku Board, one for the Sudoku game itself, and one for drawing the UI. The game will be ran as a script, e.g. python sudoku.py, and will take in a --board argument in which the puzzle will be drawn off of.
Hopefully, you’ll leave with an understanding on how to:
use a Python class to save/remember/maintain the state of a particular item (in our case, the puzzle)
get familiar with tkinter library
program from the user’s perspective; accepting keyboard and mouse input
implement simple game logic (a solved or unsolved puzzle state)