我的程序baz從我的方法中在新線程中調(diào)用一個spam方法?,F(xiàn)在,我需要從這個新線程中每秒檢查一次self.track的值。import threadingclass A(threading.Thread):def __init__(self, player): self.track = Truedef Baz(self): // how do i check the value of self.track every 1 second here while self.track: // do somethingdef Spam(self): player_thread = Thread(target=self.Baz) player_thread.start()每秒說一次,如何檢查?
添加回答
舉報
0/150
提交
取消