把控件记录到列表中:
from tkinter import *
lis = []
def _start():
new = Label(root,text='标签')
new.pack()
lis.append(new)
def _del():
if len(lis)==0:
pass
else:
lis[-1].destroy()
del lis[-1]
root = Tk()
but1 = Button(root,text='点我添加按钮',command=_start)
but2 = Button(root,text='点我删除按钮',command=_del)
but1.pack()
but2.pack()
root.mainloop()