비슷한 코드 구조를 여러 번 반복 했으므로 threading.Thread
구현에서이 코드를 보았을 때 회귀 함수가 아니므로 더 이상 메모리를 사용하지 말라는 질문을 할 필요가있었습니다. 전화 해 ... 그렇지?.after() 메서드 재귀 호출
class arbitraryClass():
def __init__(self, master):
... # other miscellaneous codes not shown here
self.periodicCall() # within the __init__() method
def periodicCall(self):
self.doSomething() #arbitrary method
self.master.after(100, self.periodicCall)
... # other miscellaneous codes not shown here
거의 확실하게 재귀 호출은 아니지만 'self.master'의 유형에 대해 알려주지 않으면 확신 할 수 없습니다. 대부분의 경우 메서드는 메서드에 대한 첫 번째 호출이 반환 된 후 'periodicCall' 메서드를 호출하도록합니다. – Duncan
안녕 Duncan. 여기에있는 'self.master'는 전체 프로그램의 루트라고 가정합니다. 즉, 일반적으로 import 문을 호출하는 곳과 같은 수준입니다. –