mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 04:41:10 +00:00
simple prettyprint func
This commit is contained in:
parent
7da902b97a
commit
6472f7fdd6
1 changed files with 9 additions and 6 deletions
15
main.py
15
main.py
|
|
@ -1,12 +1,15 @@
|
|||
import psutil
|
||||
from sensors import Sensors
|
||||
from colorama import Fore, Style, Back
|
||||
|
||||
|
||||
def get_temperatures():
|
||||
sensors = psutil.sensors_temperatures()
|
||||
def pretty_print():
|
||||
s = Sensors.get_temperatures()
|
||||
|
||||
for k in sensors:
|
||||
print(f"{k}: {sensors[k]}")
|
||||
for k, v in s.items():
|
||||
print(f"{Back.CYAN}{k}{Style.RESET_ALL}")
|
||||
|
||||
for sensors in v:
|
||||
print(f"{sensors.sensor_label}: {sensors.current_temp}°C")
|
||||
|
||||
if __name__ == "__main__":
|
||||
get_temperatures()
|
||||
pretty_print()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue