Skip to content

jkpatel09/battery_monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Battery Monitor

Installation

Run the following command in your terminal to install all required libraries:

pip install psutil
pip install pygame
pip install plyer

Alternatively, install all dependencies in one command:

pip install psutil pygame plyer

Ensure you're using Python 3.6 or later. You can check your Python version with:

python --version

PyInstaller is the primary tool used for creating executables. Install it with:

pip install pyinstaller

Additionally, win10toast may be required for Windows notifications. Install it with:

pip install win10toast

Project Structure

Ensure your folder looks like this:

/your_project_folder
├── battery_monitor.py
├── warning.wav
├── battery_icon.ico

Creating an Executable

Run the following command to generate the .exe file:

pyinstaller --onefile --windowed --add-data "warning.wav;." --icon=battery_icon.ico --hidden-import=plyer.platforms.win.notification --hidden-import=win10toast battery_monitor.py

After PyInstaller completes, you'll find the .exe file in the dist folder:

/your_project_folder
├── dist/
│   └── battery_monitor.exe
├── build/
├── battery_monitor.spec

Linux/macOS Users

If you're on Linux or macOS, adjust the --add-data syntax to use : instead of ;:

--add-data "warning.wav:."

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages