def stopBtnClicked(self): try: self.flag_fow = 0 self.flag_bak = 0 self.flag_rig = 0 self.flag_lef = 0 print(Thread.active_count()) except: pass