So earlier in my program, I use the line
l.bind("<Button-1>",lambda e: getSide(i))
and when I click on the element, it works fine.
However, later I use the line
l.bind("<Button-1>",lambda e: sortby(x))
for a different local object.
getSide
is a stub that prints the value of i
defined when binding. sortby
is a Quicksort that (for debugging purposes) prints the value of x
at the start. The curious thing is that while getSide
returns the correct value, sortby
does not.
getSide
returns i
, whereas sortby
prints len(column)-1
, i.e the last Label to be bound.