2017年8月27日 星期日

Python 的內建 GUI 模組 Tkinter 建立視窗----Colorized Labels in various fonts







from tkinter import *

root = Tk()

Label(root, 
text="Red Text in Times Font",
fg = "red",
font = "Times").pack()
Label(root, 
text="Green Text in Helvetica Font",
fg = "light green",
bg = "dark green",
font = "Helvetica 16 bold italic").pack()
Label(root, 
text="Blue Text in Verdana bold",
fg = "blue",
bg = "yellow",
font = "Verdana 10 bold").pack()

root.mainloop()

沒有留言:

張貼留言