Remove ()
from win1.destroy()
and win2.destroy()
.
Tkinter.Button(win1, text='Woho!',command=win1.destroy()).pack()
Tkinter.Button(win2, text='Woho!',command=win2.destroy()).pack()
^^
It cause win1.destroy
method call, and use the return value of the method as callback, instead of the method itself.; cause the main window destroy before Button creation.
Tkinter.Button(win1, text='Woho!',command=win1.destroy).pack()
Tkinter.Button(win2, text='Woho!',command=win2.destroy).pack()