2022年11月17日 星期四

Python GUI 配置管理員pack() EX3.26 , 3.27 , 3.28 , 3.29 , 3.30

 # ch3_26.py

from tkinter import *


window = Tk()

window.title("ch3_26")              # 視窗標題

lab1 = Label(window,text="標籤1",relief="raised")

lab2 = Label(window,text="標籤2",relief="raised")

lab3 = Label(window,text="標籤3",relief="raised")

lab4 = Label(window,text="標籤4",relief="raised")

lab5 = Label(window,text="標籤5",relief="raised")

lab6 = Label(window,text="標籤6",relief="raised")

lab7 = Label(window,text="標籤7",relief="raised")

lab8 = Label(window,text="標籤8",relief="raised")

lab1.grid(row=0,column=0)

lab2.grid(row=0,column=1)

lab3.grid(row=0,column=2)

lab4.grid(row=0,column=3)

lab5.grid(row=1,column=0)

lab6.grid(row=1,column=1)

lab7.grid(row=1,column=2)

lab8.grid(row=1,column=3)


window.mainloop()


# ch3_27.py

from tkinter import *


window = Tk()

window.title("ch3_27")              # 視窗標題

lab1 = Label(window,text="標籤1",relief="raised")

lab2 = Label(window,text="標籤2",relief="raised")

lab4 = Label(window,text="標籤4",relief="raised")

lab5 = Label(window,text="標籤5",relief="raised")

lab6 = Label(window,text="標籤6",relief="raised")

lab7 = Label(window,text="標籤7",relief="raised")

lab8 = Label(window,text="標籤8",relief="raised")

lab1.grid(row=0,column=0)

lab2.grid(row=0,column=1,columnspan=2)

lab4.grid(row=0,column=3)

lab5.grid(row=1,column=0)

lab6.grid(row=1,column=1)

lab7.grid(row=1,column=2)

lab8.grid(row=1,column=3)


window.mainloop()


# ch3_28.py

from tkinter import *


window = Tk()

window.title("ch3_28")              # 視窗標題

lab1 = Label(window,text="標籤1",relief="raised")

lab2 = Label(window,text="標籤2",relief="raised")

lab3 = Label(window,text="標籤3",relief="raised")

lab4 = Label(window,text="標籤4",relief="raised")

lab5 = Label(window,text="標籤5",relief="raised")

lab7 = Label(window,text="標籤7",relief="raised")

lab8 = Label(window,text="標籤8",relief="raised")

lab1.grid(row=0,column=0)

lab2.grid(row=0,column=1,rowspan=2)

lab3.grid(row=0,column=2)

lab4.grid(row=0,column=3)

lab5.grid(row=1,column=0)

lab7.grid(row=1,column=2)

lab8.grid(row=1,column=3)


window.mainloop()

# ch3_29.py

from tkinter import *


window = Tk()

window.title("ch3_29")              # 視窗標題

lab1 = Label(window,text="標籤1",relief="raised")

lab2 = Label(window,text="標籤2",relief="raised")

lab4 = Label(window,text="標籤4",relief="raised")

lab5 = Label(window,text="標籤5",relief="raised")

lab8 = Label(window,text="標籤8",relief="raised")

lab1.grid(row=0,column=0)

lab2.grid(row=0,column=1,rowspan=2,columnspan=2)

lab4.grid(row=0,column=3)

lab5.grid(row=1,column=0)

lab8.grid(row=1,column=3)


window.mainloop()

# ch3_30.py

from tkinter import *


window = Tk()

window.title("ch3_30")              # 視窗標題

lab1 = Label(window,text="標籤1",relief="raised")

lab2 = Label(window,text="標籤2",relief="raised")

lab3 = Label(window,text="標籤3",relief="raised")

lab4 = Label(window,text="標籤4",relief="raised")

lab5 = Label(window,text="標籤5",relief="raised")

lab6 = Label(window,text="標籤6",relief="raised")

lab7 = Label(window,text="標籤7",relief="raised")

lab8 = Label(window,text="標籤8",relief="raised")

lab1.grid(row=0,column=0,padx=5,pady=5)

lab2.grid(row=0,column=1,padx=5,pady=5)

lab3.grid(row=0,column=2,padx=5,pady=5)

lab4.grid(row=0,column=3,padx=5,pady=5)

lab5.grid(row=1,column=0,padx=5)

lab6.grid(row=1,column=1,padx=5)

lab7.grid(row=1,column=2,padx=5)

lab8.grid(row=1,column=3,padx=5)


window.mainloop()



















沒有留言:

張貼留言

113 學年度第 1 學期 RFID應用課程 Arduino程式

113 學年度第 1 學期 RFID應用課程 Arduino程式 https://www.mediafire.com/file/zr0h0p3iosq12jw/MFRC522+(2).7z/file 內含修改過後的 MFRC522 程式庫 (原程式有錯誤) //定義MFRC522...