Render the current time and display. Loops forever, updating every second
(dev)
| 70 | |
| 71 | |
| 72 | def clock(dev): |
| 73 | """Render the current time and display. |
| 74 | Loops forever, updating every second""" |
| 75 | while True: |
| 76 | if is_thread_stopped() or is_dev_disconnected(dev.device): |
| 77 | reset_thread() |
| 78 | return |
| 79 | now = datetime.now() |
| 80 | current_time = now.strftime("%H:%M") |
| 81 | print("Current Time =", current_time) |
| 82 | |
| 83 | show_string(dev, current_time) |
| 84 | time.sleep(1) |
no test coverage detected