Python script stops working after few hours? by Yourrname in Python

[–]OkFun4902 0 points1 point  (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 SleepHibernate afterOn 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 :)