0
나는 'automode'를 추가하고 싶은 어플리케이션이있다.QMainWindow는 watchdog.start()에서 동결시키는 법을 동시에 작동합니까?
def start_stop_automode(self):
self.set_auto()
if not self.auto_mode_btn.isChecked() and self.observer.is_alive():
self.observer.stop()
self.observer.join()
return
else:
self.observer.start()
while True:
try:
time.sleep(1)
except KeyboardInterrupt:
self.observer.stop()
self.observer.join()
그것은 차례로 watchdog
event
를 트리거 한 파일에 일부 기능을 실행하는 watchdog
FileSystemEventHandler
클래스를 시작하는 슬롯을 호출합니다.
class Event(FileSystemEventHandler):
def on_created(self, event):
input_path = event.src_path
if input_path.endswith('_1.CSV'):
if self.file_creation_finished(input_path):
file = os.path.split(input_path)[-1].rstrip('.CSV')
file = file.split('_')[0]
self.exec_funk(order=file)
는 debugg 통해 난 내부 FileSystemEventHandler
클래스 코드 watchdog
실행 중에 QMainWindow
실제로 작동되는 누락 기능을 제외하고 정확하게 행하는 것을 알았다. 어떻게 둘 다 수용합니까?