Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4151

Python • Re: Button to restart Pi, button to restart program

$
0
0

Any of them?
I was unable to get the first two to work with a virtual environment. And the event driven suggestion would not work because you cannot start a thread more than once, which I could not find a way around. I am looking forward to exploring these concepts in the future if my hobbies take me there.
You do realise that if you sleep for 1 second you will miss a lot of button presses that last less than a second?
I do, but for the scope of this hobby project it is fine to hold it down for two seconds. I happened to figure out the countdown feature after spending time learning the new concepts presented to me in the post. I just can't spend more time on this script for fine-tuning.
Ah, no time to do it properly, but plenty of time to fix it.

Statistics: Posted by ame — Fri Aug 30, 2024 2:44 am



Viewing all articles
Browse latest Browse all 4151

Trending Articles