import tkinter

root = tkinter.Tk() #生成root主窗口
label = tkinter.Label(root, text='Hello,GUI') #生成标签
label.pack()        #将标签添加到主窗口
button1 = tkinter.Button(root,text='QUIT', command=root.quit) #生成button1
button1.pack(side=tkinter.LEFT)         #将button1添加到root主窗口
button2 = tkinter.Button(root,text='Button2')
button2.pack(side=tkinter.RIGHT)
root.mainloop()             #进入消息循环（必需组件）
50ce4b193e9e72ce7f297f454a60866e02cc0e28
<mask token>

<mask token>
label.pack()
<mask token>
button1.pack(side=tkinter.LEFT)
<mask token>
button2.pack(side=tkinter.RIGHT)
root.mainloop()

<mask token>
root = tkinter.Tk()
label = tkinter.Label(root, text='Hello,GUI')
label.pack()
button1 = tkinter.Button(root, text='QUIT', command=root.quit)
button1.pack(side=tkinter.LEFT)
button2 = tkinter.Button(root, text='Button2')
button2.pack(side=tkinter.RIGHT)
root.mainloop()

import tkinter
root = tkinter.Tk()
label = tkinter.Label(root, text='Hello,GUI')
label.pack()
button1 = tkinter.Button(root, text='QUIT', command=root.quit)
button1.pack(side=tkinter.LEFT)
button2 = tkinter.Button(root, text='Button2')
button2.pack(side=tkinter.RIGHT)
root.mainloop()

import tkinter

root = tkinter.Tk() #生成root主窗口
label = tkinter.Label(root, text='Hello,GUI') #生成标签
label.pack()        #将标签添加到主窗口
button1 = tkinter.Button(root,text='QUIT', command=root.quit) #生成button1
button1.pack(side=tkinter.LEFT)         #将button1添加到root主窗口
button2 = tkinter.Button(root,text='Button2')
button2.pack(side=tkinter.RIGHT)
root.mainloop()             #进入消息循环（必需组件）