So I'm trying to print items in a list dynamically on 10 tkinter Label
s using a for loop. Currently I have the following code:
labe11 = StringVar()
list2_placer = 0
list1_placer = 1
mover = 227
for items in range(10):
item_values = str(list1[list1_placer] + " " +list2[list2_placer])
Label(canvas1, width="100", height="2",textvariable=labe11).place(x=200,y=mover)
labe11.set(item_values)
list1_placer = list1_placer +1
list2_placer = list2_placer +1
mover = mover +50
Where list1
and list2
are lists containing strings or integers from a separate function and have more than 10 items and only the first 10 are wanted.
Currently this just prints the last item in the list on 10 separate labels. Thanks in advance!