pack布局
import tkinter as tk
win=tk.Tk()
win.geometry('350x250')
win.title('pack')
tk.Label(win,text='top',bg='yellow',font=('Arial',12)).pack(side='top')
tk.Label(win,text='left',bg='yellow',font=('Arial',12)).pack(side='left')
tk.Label(win,text='bottom',bg='yellow',font=('Arial',12)).pack(side='bottom')
tk.Label(win,text='right',bg='yellow',font=('Arial',12)).pack(side='right')
win.mainloop()
place布局
import tkinter as tk
win=tk.Tk()
win.geometry('350x250')
win.title('pack')
tk.Label(win,text='top',bg='yellow',font=('Arial',12)).place(x=10,y=30)
win.mainloop()
grid布局
import tkinter as tk
win=tk.Tk()
win.geometry('350x250')
win.title('grid')
tk.Label(win,text='grid1',font=('Arial',12)).grid(row=2,column=2)
tk.Label(win,text='grid2',font=('Arial',12)).grid(row=3,column=4)
win.mainloop()