代码拉取完成,页面将自动刷新
from tkinter import *
root = Tk()
w = Label(root,
text="Hello Tkinter")
w.pack()
.pack() method tell Tk to fit the size of window to the given text
# ending mainloop
root.mainloop()
from tkinter import *
root = Tk()
root.title("Drynamic Label")
''
def stop():
root.destroy()
c=0
def start():
def count():
global c
c+=1
w.config(text=str(c))
w.after(100,count)
count()
w = Label(root, justify=CENTER)
w.pack()
justify options are : LEFT, RIGHT, CENTER
start()
b= Button(root, text="Stop", command = stop)
b.pack()
root.mainloop()
from tkinter import *
root = Tk()
logo = PhotoImage(file="Images/tk.png")
Some formates will not support by PhotoImage then you have to workaround
w = Label(root,
image=logo)
w.pack()
root.mainloop()
from tkinter import *
root = Tk()
data = "Python Pune"
w = Label(root,
fg='white',
bg='black',
text=data,
font=("Helvetica", 16)
)
w.pack()
root.mainloop()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。