문서 편집 권한이 없습니다. 다음 이유를 확인해주세요:
요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다: 사용자.
== 파이썬 스케줄러 모듈 - APSchedule == https://apscheduler.readthedocs.io/en/latest/ Advanced Python Scheduler 파이썬의 스케줄러 모듈입니다. cron 또는 특정 주기로 해당 기능을 실행 하고자 할 경우 사용 === 설치 === # pip install apscheduler === 사용예시 === # scheduler.py <source lang=python> #!/usr/bin/env python #-*- coding: utf-8 -*- from datetime import datetime import time import os from apscheduler.schedulers.background import BackgroundScheduler def tick(): print('Tick! The time is: %s' % datetime.now()) if __name__ == '__main__': scheduler = BackgroundScheduler() scheduler.add_job(tick, 'interval', seconds=3) scheduler.start() print('Press Ctrl+{0} to exit'.format('Break' if os.name == 'nt' else 'C')) try: # This is here to simulate application activity (which keeps the main thread alive). while True: time.sleep(2) except (KeyboardInterrupt, SystemExit): # Not strictly necessary if daemonic mode is enabled but should be done if possible scheduler.shutdown() </source> # 실행 <source lang=python> # chmod 700 scheduler.py # ./scheduler.py </source> [[Category:python]]
문서 저장 미리 보기 차이 보기 취소