import tkinter as tk
win=tk.Tk()
win.title('主窗口')
win.geometry('350x250')
def click():
win2=tk.Toplevel(win)
win2.title('小窗口1')
win2.geometry('250x150')
label=tk.Label(win2,text='这是一个小窗口',bg='yellow',font=('Arias',20))
label.pack()
def click2():
win3=tk.Toplevel(win)
win3.title('小窗口2')
win3.geometry('250x150')
label=tk.Label(win3,text='这是一个小窗口',bg='yellow',font=('Arias',20))
label.pack()
button=tk.Button(win,text='小窗口1',font=('Arias',12),bg='green',command=click)
button2=tk.Button(win,text='小窗口2',font=('Arias',12),bg='green',command=click2)
button.pack()
button2.pack()
win.mainloop()