Disable screen-lock and sleep on Windows Python GUI application to turn on/off screen-lock and sleep on Windows Uses SetThreadExecutionState with ES_CONTINUOUS see SetThreadExecutionState