i have the following problem: i would like to list all filenames from a folder to a tkinter window + a checkbox (with a unique variable) near each filename. so far i have this:
import tkinter as tk
def gui():
master=tk.Tk()
files=next(os.walk('forms'))[2]
i=1
for f in files:
'unique var name??'=tk.IntVar()
tk.Checkbutton(master, text=f, variable='unique var name??').grid(row=i)
master.mainloop()
gui()
this code works, but returns only the last file name from the respective folder + a checkbox in the tkinter window. i don't know how to define a unique tk.IntVar() variable for every checkbox and how to make the master.mainloop() window list all file names. i use python 3.4 on win 7.
thank you in advance!