import tkinter as tk
chuangkou=tk.Tk()
chuangkou.title("我的GUI")
sw=chuangkou.winfo_screenwidth()
sh=chuangkou.winfo_screenheight()
sw_=(sw-400)/2
sh_=(sh-350)/2
chuangkou.geometry("400x350+{:.0f}+{:.0f}".format(sw_,sh_))
**#label**
label1=tk.Label(chuangkou,text="你好")
label1.pack()
label2=tk.Label(chuangkou,bitmap="question")
label2.pack()
image_file=tk.PhotoImage(file=r"C:\Users\许博\Desktop\welcome.gif")
label3=tk.Label(chuangkou,image=image_file)
label3.pack()
chuangkou.mainloop()
Python tkinter库(label)
最新推荐文章于 2023-09-11 19:45:00 发布