-1
import tkinter as tk

def close_window():
    print ("")
    window.destroy()

window = tk.Tk()
window.geometry("750x350")

username = tk.Label(window, text = "Enter Username")

password = tk.Label(window, text = "Enter Password")

input1 = tk.Entry(window)

input2 = tk.Entry(window, show = "*")

confirm = tk.Button(text="Confirm", command = close_window()) 

input1.place(x=400, y=35)

input2.place(x=400, y=65)

username.place(x=150, y=35)

password.place(x=150, y=65)

confirm.place(x=400, y=100)

confirm.pack()

window.mainloop()

I am trying to make a forum which closes itself once you click confirm. Also, i use spyder (just in case) and i have just started the concept of tkinter. I tried to find the answer on google but it was not so successful.

No one
  • 1
  • 1

1 Answers1

0

you're calling "close_window()" in this line: "confirm = tk.Button(text="Confirm", command = close_window()) "

SalahM
  • 74
  • 2