Windows – How to prevent Windows 10 from any kind of sleep or hibernate when running python script

hibernatepythonsleepwindowswindows 10

I'm running a python script, which takes a couple of days. But Windows 10 seems keep pausing the script after some time, i.e. when I leave for a while the program stops (screen off also), but when I come back and do whatever things, the program will resume. Although I change all the power options in Windows 10, like

"never go to sleep when plugged in"

"never turn off hard disk"

"allow hybrid sleep: off"

"never hibernate"

Extra information: Windows edition: Windows 10 pro; 64-bit Operating System, x64-based processor;

python: Python 2.7.12 |Continuum Analytics, Inc.| (default, Jun 29 2016, 11:42:13) [MSC v.1500 32 bit (Intel)] on win32

Best Answer

Use the tool Don't Sleep while running your python script:

Don't Sleep is a small portable program to prevent system shutdown, Standby, Hibernate, Turn Off and Restart.

enter image description here

This prevents all action that can interrupt your script.

Related Question