728x90
반응형
!pip install schedule
import schedule
import time
def x():
print("hi")
# 10초에 한번씩 실행
schedule.every(10).seconds.do(x)
# 10분에 한번씩 실행
schedule.every(10).minutes.do(x)
# 매 시간 실행
schedule.every().hours.do(x)
# 매일 오전 10시에 실행
schedule.every().day.at("10:00").do(x)
# 매주 수요일 저녁 8시에 실행
schedule.every().wednesday.at("20:00").do(x)
while True:
schedule.run_pending()
time.sleep(1)
반응형
'프로그래밍 언어 > Python' 카테고리의 다른 글
Python) conda 가상환경 생성 및 실행 (0) | 2022.03.21 |
---|---|
Python) conda install 패키지를 찾을 수 없는 경우 (0) | 2022.03.21 |
Python) 자료형 (0) | 2021.05.30 |
Python - .ipynb(notebook)파일을 .py(파이썬)파일로 변경하기 (0) | 2021.01.26 |
Python - 웹 크롤링이란? (feat.BeautifulSoup) (0) | 2021.01.15 |
댓글