반응형
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 | 29 | 30 |
Tags
- error
- socketio
- 맛집
- python
- ChatGPT
- 터미널
- GPT
- humble
- no space left on device
- 스팸
- ROS2
- TTS
- 딥러닝
- ros
- 분당맛집
- 판교
- ubuntu
- tensorflow
- string
- timm
- Torch
- pytorch
- 티스토리챌린지
- openAI
- opencv
- CUDA
- Android
- 오블완
- linux
- CLASS
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