There is: a list of image names for applying them to the buttons ( image_list ), the variables image_list = "../Images" and image_int = len (os.listdir (image_dir)) .
After the loop for x in range (imagelist) starts :
In the body of the cycle:
Y = 0 Y+= 10 #ImageLink = PhotoImage(file="../Images/img%i"% i +".gif") FrameButton = Button(root,text=images_names[i], width=10,height=1, relief=GROOVE).grid(row=0,column=Y) The problem is that in the top left corner there is only the last button from the list, and not a column (top to bottom).
And the second question is how each generated button is assigned a link to different images, given that the image name is also generated in a loop ( "img% i"% i.gif " ).