I implement a python program with tkinter and I want to show the result from fct1 after I click the button. When I run the program the result appears in the window even if I did not click the button.
from tkinter import *
def fct1():
u = 0.1
while 1 + u != 1:
u /= 10
return u * 10
def create_gui():
window = Tk()
window.title("Math")
window.geometry('350x200')
label1 = Label(text=' ')
label1.grid(column=2, row=0)
btn = Button(window, text="Function1", command=clicked(label1))
btn.grid(column=1, row=0)
window.mainloop()
def clicked(label1):
output = fct1()
label1['text']=str(output)
create_gui()