Hi guys can someone help me with optimalization of this code?
i got 5 chechk box (named Px) and 5 other (named Rx)
I wish: on begin all check box got status NORMAL, when we mark P1 we can't mark R1 (status DISABLED)- same thing relation between P2-R2, P3-R3 ... in two ways.
In def confirm i wrote algorythm but i think it's possible to make short way.
one think is wrong when we mark R1 at first then we mark P1, R1 got status DISABLED but mark will stay on it(dot). example : http://prntscr.com/op9ydv
i got 5 chechk box (named Px) and 5 other (named Rx)
I wish: on begin all check box got status NORMAL, when we mark P1 we can't mark R1 (status DISABLED)- same thing relation between P2-R2, P3-R3 ... in two ways.
In def confirm i wrote algorythm but i think it's possible to make short way.
one think is wrong when we mark R1 at first then we mark P1, R1 got status DISABLED but mark will stay on it(dot). example : http://prntscr.com/op9ydv

import numpy as np s=np.zeros((10),dtype=object) ... self.checkvars = [IntVar() for i in range(10)] self.chk1 = Checkbutton(root, text='P1', var=self.checkvars[0], command=self.confirm) self.chk2 = Checkbutton(root, text='P2', var=self.checkvars[1], command=self.confirm)... self.chk11 = Checkbutton(root, text='R1', variable=self.checkvars[5], command=self.confirm) self.chk12 = Checkbutton(root, text='R2', variable=self.checkvars[6], command=self.confirm)... def confirm(self): s[:] = [1 if v.get() else 0 for v in self.checkvars] if s[0] == 1: s[5]=0 self.chk11.config(state=DISABLED) if s[0] == 0: self.chk11.config(state=NORMAL)