How can I get TK button commands to take in a parameter with a variable (Python)
问题 This has stumped me for over a week. As the title asks, how can I get TK button commands to take in a parameter with a variable? Here is the exact code I'm using: i=0 # Make a Staff list button staffButton = Button(masterFrame, text='Staff List', width=20, justify=LEFT, #command=lambda:self.openTabHere(isLeft,STAFF_LIST_TAB)) command=lambda:self.openTabHere(isLeft,i)) staffButton.grid(column=0, row=1) # Make a course list button courseButton = Button(masterFrame, text='Course List', width=20,