python GUI pack方法
from tkinter import *
root = Tk()
root.title("pack方法")
root.geometry("300x180")
print("执行前", root.pack_slaves())
ok_label = Label(root, text="OK",
font="Times 20 bold",
fg="white", bg="blue")
ok_label.pack(anchor=S, side=RIGHT,
padx=10, pady=10)
ng_label = Label(root, text="NG",
font="Times 20 bold",
fg="white", bg="red")
ng_label.pack(anchor=S, side=RIGHT,
pady=10)
print("执行后", root.pack_slaves())
for pack in root.pack_slaves():
print("info", pack.info())
print("size", pack.size())
root.mainloop()