0

I am making a series of buttons from a list of lists. When you click a button it's supposed to pass values from the list through to a function. but whichever button I click on it always gives me the last set of values from the list, not the ones its supposed it

v=1
for i in x:
    getattr(self.ui, "button_{}_{}".format(plane_1, 
                v)).setText(i[0])
    getattr(self.ui, "button_{}_{}".format(plane_1, 
                v)).clicked.connect(lambda:self.display_flight(i[2], i[1], i[3], i[4], 
                i[6], i[7], i[8]))
    v += 1

if I put a print for the values being passed it prints out each list in the list.

Ben
  • 11
  • 4

0 Answers0