Use a Python script to prevent being locked out or screen saver appearing from inactivity/being idle

Опубликовано: 04 Март 2025
на канале: Too Long; Didn't Watch Tutorials
1,387
8

This video will show you how to create a little script to prevent your screen from being locked or your screensaver from being triggered - even if you are idle. If you work remotely and want to step away for a few minutes, there's nothing more annoying than having to log back into your work server (even more annoying if you have to use two factor authentication). This can be done in 5 lines of code and even the biggest noob could do it. If you can install Python, then you can definitely do this! It's only a matter of creating a new file with the provided code, and running it!

I do want to add a disclaimer that this should only be used when no one else is around or if you are working remotely. Screen locks are a good security measure for protecting your computer, especially from people walking by.

Here are the video highlights:

Intro: 0:00
Overview/Explanation: 0:06
Triggering screen saver BEFORE using Python script: 0:25
Creating new Python script/adding the code: 0:55
Explanation of code: 1:15
Running the script to prevent the screen saver/lock out from triggering: 1:39
Wrapping up/demonstrating how to run script as a Python file: 2:18
End Scene: 2:33

LINK TO PYTHON CODE: https://controlc.com/9c9aa411