title: how to display different images using grid function using tkinter?
body: <p>I want to display the images in the folder using <code>grid()</code>. But when I tried with the following code, I got the output with single image iterated. </p>
  
  <p>My code:</p>
  
  <pre><code>def messageWindow():
      win = Toplevel()
      path = 'C:\Users\HP\Desktop\dataset'
      for r in range(7):
          for c in range(10):
              for infile in glob.glob(os.path.join(path,'*.jpg')):
                im = Image.open(infile)
                resized = im.resize((100, 100),Image.ANTIALIAS)
                tkimage = ImageTk.PhotoImage(resized)
                myvar=Label(win,image = tkimage)
                myvar.image = tkimage
                myvar.grid(row=r,column=c)   
  root = Tk()
  button = Button(app, text='Images in DataSet',command = messageWindow)
  button.pack(padx = 1, pady = 1,anchor='ne')
  button.place( x = 850, y = 60)
  root.mainloop()  
  </code></pre>
  
  <p>When I run this code, after 5 minutes a child window will popup, and it will display a single image like this;</p>
  
  <p><img src="https://i.stack.imgur.com/NrNgX.png" alt="enter image description here"></p>
  
  <p>But how to get all the images in the dataset? Any suggestions are welcome.
  Tkanks for your support!</p>