Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- def open_window():
- top = Toplevel()
- top.title("top window")
- top.geometry("300x300+120+120")
- button1 = Button(top, text="close", command=top.destroy)
- button1.pack()
- root = Tk()
- button = Button(root, text="open window", command=open_window)
- button.pack()
- root.geometry("300x300+120+120")
- root.mainloop()
RAW Paste Data