I'm working on making a front end of a database with python tkinter. To display the records, I use a for loop for fill out each row. In each row I'm trying to add a button that would open to that record information, but in every row's button would open to the last record. So that would indicate that the command for each button is being over written to the last value this could also mean that the buttons are not unique. I would like help in trying to generate a unique button for each loop or a solution to the instruction for the command from being over written.
list1 = ["t1", "t2", "t3"]
dcount=0
sizel=len(list1)
for x in range(0,sizel):
button = Button(frame, text="test", command=lambda:action(frame,list1[x]))
button.grid(row=dcount,column=0)
dcount=dcount+1
Any help would be appreciated. I did see some solutions where they put values in front of lambda but I would not manage to get that to work.