Simple wakelock / keep-awake / stay-awake
Project description
⏰😴 wakepy
Simple wakelock written in Python. Keeps your computer from going to sleep.
- Command line utility
- Can be added into your long running scripts
Requirements
Wakepy is currently Windows only. Feel free to submit pull request(s) for other platforms.
Installing
pip install wakepy
Usage
Start from command line
python -m wakepy
Starts the program. While running, computer will not go to sleep. If battery running out, Windows might force laptop to sleep.
Set keepawake within a python script
from wakepy import set_keepawake, unset_keepawake
set_keepawake()
# do stuff that takes long time
unset_keepawake()
Details
Windows
The program simply calls the SetThreadExecutionState with the ES_SYSTEM_REQUIRED
flag, when setting the keepawake, and removes flag when unsetting. The flag cannot prevent sleeping if
- User closes the lid of their laptop
- User presses power button
- User selects Sleep from the Start menu.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wakepy-0.2.0.tar.gz
(1.9 kB
view details)
File details
Details for the file wakepy-0.2.0.tar.gz
.
File metadata
- Download URL: wakepy-0.2.0.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d293aa788376b5677eab396bba749f0bbc1c63152766f4fc1cf90ce3bfb27ea |
|
MD5 | f4fa87716ce5e3be86c73124879abe16 |
|
BLAKE2b-256 | c579480fc12bba4a35191e8effadf2332fc0612c418749ac4101dfb812c33f02 |