def flag(i, com, xi, yi): """ Function register click on a checkbutton and performs command :param i: flag number which corresponds to command number in list_cb :param com: command name :param xi: x coordinate of chk :param yi: y coordinate of chk """ chk = Checkbutton(window1, variable=list_cb[i], command=com) chk.focus() chk.place(x=xi, y=yi) return