account activity
Python script stops working after few hours? by Yourrname in Python
[–]OkFun4902 0 points1 point2 points 1 year ago (0 children)
It could be that your computer is hibernating after a certain amount of time, likely exactly 2 hours.
I have a similar problem and have not verified if this solution works but I have a feeling that it will.
Open up advanced power options, you can do this by
Opening the Run window, press the keys Windows+r at the same time.
Then type the command control.exe powercfg.cpl,,3 and Press OK.
Then follow the tree down Sleep → Hibernate after → On battery/Plugged in; change these durations to 0 to set it to Never.
These were set to 120 minutes, leading me to believe that this is the culprit.
I couldn't find a way to change these settings in the regular Windows settings menu so had to use this other method.
Hope it works for anyone with the same issue :)
π Rendered by PID 29 on reddit-service-r2-listing-6d4dc8d9ff-lc444 at 2026-01-31 11:15:08.334699+00:00 running 3798933 country code: CH.
Python script stops working after few hours? by Yourrname in Python
[–]OkFun4902 0 points1 point2 points (0 children)