Send Battery Percentage Notification using Python

 








Code :

#pip install py-notifier
from pynotifier import Notification
#pip install psutil
import psutil
#putil.sensore_battery() will return the information
#related to battery
battery = psutil.sensore_battery()
#battery.percent will return the current battery prcentage
percent = battery.percent
#Notification(title, description, duration)--to send 
#notification to desktop
Notification("Battery Percentage",
                  str(percent) + "%Percent Remaining",
                  duration=10).send()

Comments

Popular posts from this blog

Python Program to Generate Password

How to become a Hacker ?