python tkinter中的label怎么实行动态改变
from tkinter import *
import tkinter.messagebox
def autoText():
global str,n
while n<10:
n=n+1
str.set(n)
n=0
root = tkinter.Tk()
str=StringVar() #StringVar是一个很强大的类,可以辅助控件动态改变值
root.geometry('300x250')
str.set('1')
warning = Label(root, textvariable=str) # 用于显示警告信息
warning.place(x=30, y=120, anchor='nw')
tkinter.Button(root, text='确认', width=10, height=1, command=autoText).place(x=150, y=115)
root.update()
root.mainloop()