Tkinter Button command getting executed before clicking the button [duplicate]
问题 This question already has answers here : Why is Button parameter “command” executed when declared? (5 answers) Closed 2 years ago . I have created a frame, In that i have two browse button, i want browse two file that ending with ".txt" extension and printing it on screen. In my scenario, browse function getting called before pressing Button's on the frame. Am expecting it should called when i press Button. Complete code attached. Kindly someone correct me what i did wrong. from Tkinter