📜  9x9 网格 tkinter - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:05.034000             🧑  作者: Mango

代码示例1
from tkinter import *

center=Th()
center.geometry('455x455')
center.title("9x9 grid")

cells = {}
for row in range(9):
    for column in range(9):
        cell = Frame(center, bg='white', highlightbackground="black",
                     highlightcolor="black", highlightthickness=1,
                     width=50, height=50,  padx=3,  pady=3)
        cell.grid(row=row, column=column)
        cells[(row, column)] = cell

center.mainloop()