Notice
Recent Posts
Recent Comments
Link
나의 개발일지
[Python] schedule 모듈 본문
schedule 모듈을 사용하면 원하는 시간, 주기마다 코드를 실행할 수 있다.
설치 : pip install schedule
import schedule
import time
def start():
print("start function")
# 10분마다 호출
schedule.every(10).minutes.do(start)
# 1시간마다 호출
schedule.every().hour.do(start)
# 매일 00시에 호출
schedule.every().day.at("00:00").do(start)
# 5~10분 마다 수행
schedule.every(5).to(10).minutes.do(start)
# 매주 월요일 수행
schedule.every().monday.do(start)
# 매주 월요일 18:00에 수행
schedule.every().monday.at("18:00").do(start)
while True:
schedule.run_pending()
time.sleep(1)
'백준' 카테고리의 다른 글
[백준] 1927 최소 힙 [Python, 파이썬] (0) | 2024.01.03 |
---|---|
[백준] 19496 큰 수 만들기 [Python, 파이썬] (0) | 2023.12.24 |
[백준] 21939 문제 추천 시스템 Version1 [Python, 파이썬] (0) | 2023.12.14 |
[백준] 20440 🎵니가 싫어 싫어 너무 싫어 싫어 오지 마 내게 찝쩍대지마🎵 - 1 [Python, 파이썬] (1) | 2023.12.11 |
[백준] 24337 가희와 탑 [Python, 파이썬] (1) | 2023.12.08 |
Comments