新建label与button,并设置位置(grid)
import tkinter as tk
root = ()
label = (root, text = ‘Label’)
(column = 3, row = 8)
button = (root, text = ‘Button’)
(column = 5, row = 1)
按钮间距设置
col_count, row_count = root.grid_size()
for col in xrange(col_count):
root.grid_columnconfigure(col, minsize=20)
for row in xrange(row_count):
root.grid_rowconfigure(row, minsize=20)