I am trying to do some work on a text file if certain checkbuttons are checked.
"Populate CheckBoxes"
Label(master, text="Pick at least one index:").grid(row=4, column=1)
Checkbutton(master, text="Short",variable=var1).place(x=5,y=60)
Checkbutton(master, text="Standard",variable=var2).place(x=60,y=60)
Checkbutton(master, text="Long",variable=var3).place(x=130,y=60)
Calling
print("Short: %d,\nStandard: %d,\nLong: %d" % (var1.get(), var2.get(),
var3.get()))
prints out 0 or 1 for each variable but when I am trying to use that value to do something it does'nt seem to call the code.
if var2.get(): <--- does this mean if = 1?
Do something
if something:,somethingwill be considered True if it is notFalse,0,[],'',{},None, ... Most empty objects (list, dictionary, string, tuple, ...) are considered False, but everything else is consideredTrue(not only 1)var1,var2,var3declared exactly?