2020
09-24
09-24
Python tkinter布局与按钮间距设置方式
新建label与button,并设置位置(grid)importtkinterastkroot=tk.Tk()label=tk.Label(root,text=‘Label')label.grid(column=3,row=8)button=tk.Button(root,text=‘Button')button.grid(column=5,row=1)按钮间距设置col_count,row_count=root.grid_size()forcolinxrange(col_count):root.grid_columnconfigure(col,minsize=20)forrowinxrange(row_count):root.grid_rowconfigure(row,minsiz...
继续阅读 >