class InterlockMotors (Interlock): def __init__(self): Interlock.__init__(self, (mu, delta, gamma, eta)) def check(self, (m, d, g, e)): if e>d: return False return True class InterlockFourcv (Interlock): def __init__(self): Interlock.__init__(self, (fourcv,)) def check(self, (p,)): m, d, g, e = p if d>m: return False return True class InterlockFourcv (Interlock): def __init__(self): Interlock.__init__(self, (fourcv, mu, delta, gamma, eta)) def check(self, (p, m, d, g, e)): mg, dg, gg, eg = p mv = mm, md, mg, me = m!=mg, d!=dg, g!=gg, e!=eg nm = mv.count(True) simult = nm > 1 if simult: m, d, g, e = p print m, d, g, e if d>m: return False return True #interlock1.close() interlock2.close() #interlock1 = InterlockMotors() interlock2 = InterlockFourcv()