I'm trying to build a menu out of given array, where the label and command are based on the array item.
arr1 = ["item0","item1","item2"]
for arg in arr1:
self.menu.add_command(label=arg, command= lambda: print(arg))
With the above code the labels works fine, but all the entries commands are printing the same text of the last arg (item2).