print(text)
button0 = tkinter.Button(frame,text="hello",command=printer("hello"))
button0.pack()
window.mainloop()
why it prints "hello" as the code starts? not when the button is pressed
you'd need to wrap printer("hello") in a lambda
yeah thanxs i figured it out
preferably use functools.partial btw
yeah, that too
Обсуждают сегодня