How can I prevent Windows 10 from any kind of sleep or hibernate when running python script?

instructions

Windows 10 offers a wide range of power options to manage the system’s power consumption. By default, Windows 10 has the system configured to automatically sleep or hibernate when running Python scripts. This can be a problem as it can interrupt the execution of a Python script and result in data loss or corruption.

Fortunately, there are ways to prevent Windows 10 from entering sleep or hibernate mode when running Python scripts. This can be done by disabling the system’s sleep and hibernation settings, adjusting the power settings, or using a power-saving plan.

1. Disabling Sleep and Hibernation Settings

The first option is to disable the system’s sleep and hibernation settings. To do this, open the Control Panel, select System and Security, and then select Power Options. In the Power Options window, select “Change when the computer sleeps” and then select “Never” from the dropdown menu. Finally, select “Save changes”.

2. Adjusting the Power Settings

The second option is to adjust the system’s power settings. To do this, open the Control Panel, select System and Security, and then select Power Options. In the Power Options window, select “Change plan settings” and then select “Change advanced power settings”.

In the Advanced Power Settings window, select “Sleep” and then select “Allow hybrid sleep”. Change the setting to “Off” and then select “Save changes”. Next, select “Hibernate” and then select “Allow hybrid sleep”. Change the setting to “Off” and then select “Save changes”.

3. Using a Power-Saving Plan

The third option is to use a power-saving plan. To do this, open the Control Panel, select System and Security, and then select Power Options. In the Power Options window, select “Create a power plan” and then select “High performance”.

In the High Performance window, select “Sleep” and then select “Never”. Next, select “Hibernate” and then select “Never”. Finally, select “Save changes”.

By following the steps outlined above, you can prevent Windows 10 from entering sleep or hibernate mode when running Python scripts. Keep in mind that these steps will only prevent Windows 10 from entering sleep or hibernate mode when running Python scripts. It is still possible for the system to enter sleep or hibernate mode when running other applications or when the system is idle.

Inquire Now

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Find your next full or part-time role here

ScaleDesk can either help you find your next full time gig or a part time side gig where you can create extra income!

Onboard with us once
Skip HR screening and go to the final interview with with only your resume and a video interview you never have to redo
Get paid electronically every month for the hours you work
We will be your reference even if you work for us once

IT Teams: Use ScaleDesk to augment your team

Schedule Demo