728x90
import sys
import logging
from watchdog.observers import Observer
from watchdog.events import LoggingEventHandler
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
path = sys.argv[1] if len(sys.argv) > 1 else '.'
event_handler = LoggingEventHandler()
observer = Observer()
observer.schedule(event_handler, path, recursive=True)
observer.start()
try:
while observer.isAlive():
observer.join(1)
finally:
observer.stop()
observer.join()
document : https://python-watchdog.readthedocs.io/en/stable/
728x90
'Data Science > Python' 카테고리의 다른 글
[python] About Dask (0) | 2023.01.28 |
---|---|
[Python] How to Async Http Request : 비동기 HTTP 요청 방법 (0) | 2022.09.30 |
[Python] Dataframe에서 Zip파일 읽기 (0) | 2022.09.27 |
[Python] pandas : Adding Multiple Columns from DatatFrame.apply() (0) | 2022.09.17 |
[Python] Faiss 활용한 Vector 유사도 측정 및 검색 (0) | 2022.09.17 |
최근댓글