Doubt tkinter python

0
  

This code creates a button for each image in the list, how do I create a command that opens a file for each button.

  coluna=0
  linha=0
  lista = ["coisa.png", "guerra.png", "mundo.png", "universo.png", "impacto.png", "guerra2.png"]
  for i in lista:
    self.i = i
    if coluna==3:
      linha+=1
      coluna=0
    framew=Frame(self.frame4, relief = RIDGE, borderwidth = '8')
    foto=PhotoImage(file=i)
    nomew = Button(framew,image=foto,font=('Calibri Light','12','bold'),bd='9',height=350,width=200)

    nomew.image=foto
    nomew.pack(side="left")
    framew.grid(row=linha, column=coluna)
    coluna+=1
    
asked by anonymous 21.01.2018 / 00:08

0 answers