2022年11月17日 星期四

Python GUI 配置管理員pack() EX3.5 , 3.5.1

 # ch3_5.py

from tkinter import *


Reliefs = ["flat","groove","raised","ridge","solid","sunken"]


root = Tk()

root.title("ch3_5")


for Relief in Reliefs:

    Label(root,text=Relief,relief=Relief,

          fg="blue",

          font="Times 20 bold").pack(side=LEFT,padx=5)


root.mainloop()


# ch3_5_1.py

from tkinter import *


bitMaps = ["error","hourglass","info","questhead","question",

           "warning","gray12","gray25","gray50","gray75"]


root = Tk()

root.title("ch3_5_1")


for bitMap in bitMaps:

    Label(root,bitmap=bitMap).pack(side=LEFT,padx=5)


root.mainloop()






沒有留言:

張貼留言

ESP32 and Node-RED with MQTT (Publish and Subscribe)

  ESP32 and Node-RED with MQTT (Publish and Subscribe) 參考來源  https://randomnerdtutorials.com/esp8266-and-node-red-with-mqtt/ mqtt_server = ...