So i have been asked to create a sudoku simulator for my A-Level assessment, with a GUI in Tkinter. I have managed to create a 9x9 grid of buttons, however i would like every 3rd line to be bold(A), or have every 3x3 group of buttons a different colour(B). Below are images of what i had in mind.
Here is my code.
from tkinter import *
#Create & Configure root
root = Tk()
Grid.rowconfigure(root, 0, weight=1)
Grid.columnconfigure(root, 0, weight=1)
root.resizable(width=False, height=False)
#Create & Configure frame
frame=Frame(root, width=900, height = 900)
frame.grid(row=0, column=0, sticky=N+S+E+W)
#Create a 9x9 (rows x columns) grid of buttons inside the frame
for row_index in range(9):
Grid.rowconfigure(frame, row_index, weight=1)
for col_index in range(9):
Grid.columnconfigure(frame, col_index, weight=1)
btn = Button(frame, width = 12, height = 6) #create a button inside frame
btn.grid(row=row_index, column=col_index, sticky=N+S+E+W)
root.mainloop()
Any help would be greatly appreciated!
PLEASE NOTE: I do later intend to add numbers to each button and make it possibile to play a Sudoku game, so please bear that in mind when creating solutions. Any help on how i could assign each button a number efficiently (in a for loop for instance) would also be appreciated!!