title: How to create multiple checkbox in loop using tkinter
body: <p>I am New to use <code>Tkinter</code>.I want to create multiple checkbox from loop.I refer <a href="https://stackoverflow.com/questions/45313992/tkinter-checkboxes-created-in-loop">Tkinter checkboxes created in loop</a> but i don't understand it.
  I want to display all files as a checkbox located in a directory.</p>
  
  <p>Help me and tell me what i need to change ?</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>from tkinter import filedialog,Checkbutton
  
  import tkinter,os
  
  window = tkinter.Tk()
  
  def browse():
  
      filez = filedialog.askdirectory(parent=window,title='Choose a file')#I choose a directory
  
      ent1.insert(20,filez)#insert the path of directory to text box
      dirs = os.listdir(filez)#gives all files of direcory
      for file in dirs:
         print(file)#Getting all files
         var = tkinter.IntVar()
         c = tkinter.Checkbutton(window,text=file,variable=var)#Create files to checkox
         c.place(x=0,y=100)
  
  
  
  window.title("First Gui")
  
  window.geometry("400x400")
  window.wm_iconbitmap("path of icon")
  
  lbl = tkinter.Label(window,text="path")
  
  lbl.place(x=0,y=60)
  
  ent1 = tkinter.Entry(window)
  
  ent1.place(x=80,y=60)
  
  btn1 = tkinter.Button(window,text="Set Path",command=browse)
  
  btn1.place(x=210,y=57)
  
  
  window.mainloop()
  </code></pre>
  
  <p>After click on button set path i want to to display all files of directory as a checkbox using browse function</p>