Skip to main content
Get Laptop Battery Percentage Using Python
Get Laptop Battery Percentage Using Python
- We are gonna use psutil python module to do this task. psutil (process and system utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network, sensors) in Python.
- It is useful mainly for system monitoring, profiling, and limiting process resources and management of running processes. It implements many functionalities offered by classic UNIX command-line tools such as ps, top, iotop, lsof, netstat, ifconfig, free and others. psutil currently supports the following platforms:
- Linux
- Windows
- macOS
- FreeBSD, OpenBSD, NetBSD
- Sun Solaris
- AIX
Installation:-
Code:
Output:
Comments
Post a Comment