Notice
Recent Posts
Recent Comments
Link
아미(아름다운미소)
python [timer] 파이썬에서 n 초마다 반복적으로 함수를 실행하는 또다른 방법 본문
범용 이벤트 스케줄러를 구현하는 sched 모듈을 사용하는 방법도 있습니다.
import sched, time
s = sched.scheduler(time.time, time.sleep)
def do_something(sc):
print "반복실행..."
s.enter(60, 1, do_something, (sc,))
s.enter(60, 1, do_something, (s,))
s.run()
'랭귀지 > python' 카테고리의 다른 글
python 비교 연산자 (0) | 2018.10.20 |
---|---|
[python]파이썬에서 외부 파일을 실행하기 위해서 사용하는 명령어 (0) | 2018.10.18 |
python n 초마다 반복적으로 함수를 실행하는 방법 (0) | 2018.10.15 |
python try...finally 와 with 문 (0) | 2018.10.14 |
Python 버전에 따른 에러처리 (0) | 2018.10.13 |
Comments