import tkinter as tk
win = tk.Tk() #建立視窗
win.title('my first window') #設定視窗標題
#win.resizable(0,0) #設定視窗不可調整大小

lb1=tk.Label(win, text='this is test:') #建立標籤
lb1.pack() #放置標籤
lb2=tk.Label(win, text='gui test:') #建立標籤
lb2.pack() #放置標籤
btn1 = tk.Button(win, text='ok')
btn1.pack()
win.mainloop #執行視窗

aa4387b79382149baeecb5425e9aa09395a2f772
<mask token>

<mask token>
win.title('my first window')
<mask token>
lb1.pack()
<mask token>
lb2.pack()
<mask token>
btn1.pack()
win.mainloop

<mask token>
win = tk.Tk()
win.title('my first window')
lb1 = tk.Label(win, text='this is test:')
lb1.pack()
lb2 = tk.Label(win, text='gui test:')
lb2.pack()
btn1 = tk.Button(win, text='ok')
btn1.pack()
win.mainloop

import tkinter as tk
win = tk.Tk()
win.title('my first window')
lb1 = tk.Label(win, text='this is test:')
lb1.pack()
lb2 = tk.Label(win, text='gui test:')
lb2.pack()
btn1 = tk.Button(win, text='ok')
btn1.pack()
win.mainloop

import tkinter as tk
win = tk.Tk() #建立視窗
win.title('my first window') #設定視窗標題
#win.resizable(0,0) #設定視窗不可調整大小

lb1=tk.Label(win, text='this is test:') #建立標籤
lb1.pack() #放置標籤
lb2=tk.Label(win, text='gui test:') #建立標籤
lb2.pack() #放置標籤
btn1 = tk.Button(win, text='ok')
btn1.pack()
win.mainloop #執行視窗
