I was working on I just couldn't get to work, I've written an example that I think displays the issue:
from tkinter import *
listing = [1, 2, 3, 4]
def PressedButton(listing):
print(listing)
global root
root = Tk()
ListButton = []
for i in range(0, len(listing)):
ListButton.append(Button(root, text= listing[i], command = lambda:
PressedButton(listing[i])))
ListButton[i].grid(row = i)
When I run this I always have the number 4 printed no matter what button I select, but all the buttons do have their correct respective number on them.
Thanks a lot for any help you guys could provide.