반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 분당맛집
- opencv
- 판교
- python
- 오블완
- CUDA
- ROS2
- tensorflow
- ChatGPT
- ros
- linux
- TTS
- 맛집
- pytorch
- GPT
- openAI
- socketio
- 스팸
- string
- Torch
- CLASS
- Android
- 딥러닝
- 터미널
- ubuntu
- humble
- no space left on device
- timm
- 티스토리챌린지
- error
Archives
- Today
- Total
목록타이머 (1)
RoBoLoG
[Python] 10초 타이머 만들기
클래스 내에 is_on 변수와 timer 함수를 포함시키고 싶다면, 다음과 같이 코드를 수정할 수 있습니다 방법1. time.sleep 사용 import threading import time class MyClass: def __init__(self): self.is_on = False def timer(self): time.sleep(10) self.is_on = True def start_timer(self): timer_thread = threading.Thread(target=self.timer) timer_thread.start() timer_thread.join() print("is_on:", self.is_on) # 클래스의 인스턴스 생성 my_object = MyClass() # 타이머 ..
Study/Python
2023. 6. 16. 16:23