I used a for loop to create many lines to draw a grid on code, and I want my lines to get clicked on and return a different color. My current code goes like this:
for i in range(100, w-100, 100):
         for n in range(100, 700, 100):
             a1 = mainCanvas.create_line(i, n, i + 100, n, tag='grid_line', width=4, activefill=player1Color,                    fill="black")
     for j in range(100, h-100, 100):
         for n in range(100, 700, 100):
             a2 = mainCanvas.create_line(n, j, n, j+100, tag='grid_line', width=4, activefill="red", fill="black")
I have created the lines, all i need now is individual coordinates to store them, and I cant figure out how to call them one by one as a variable.
 
    