Tkinter Frame框架
import tkinter as tk
# 实例化一个窗口对象
window = tk.Tk()
# 设置title
window.title('my window')
# 设置大小,XxY的字符串格式
window.geometry('600x400')
tk.Label(window,text='on the window').pack()
frm = tk.Frame(window)
frm.pack()
frm_left = tk.Frame(frm,)
tk.Label(frm_left,text='on the frm_left').pack()
tk.Label(frm_left,text='on the frm_left2').pack()
frm_right = tk.Frame(frm,)
tk.Label(frm_right,text='on the frm_right').pack()
frm_left.pack(side='left') # 在主frame的左边
frm_right.pack(side='right') # 在主frame的右边
frm_left.pack()
frm_right.pack()
window.mainloop() # 循环显示