This commit is contained in:
Thomas Forgione 2025-04-14 22:51:33 +02:00
parent f058d240bd
commit 807fe1d479

View File

@ -3,7 +3,6 @@
import json import json
import os import os
import os.path import os.path
import psutil
import subprocess import subprocess
import sys import sys
@ -140,6 +139,12 @@ def to_bar(x):
def monitor_stats(): def monitor_stats():
try:
import psutil
except:
print('Stats requires psutil (run `pip install psutil`)', file=sys.stderr)
sys.exit(1)
""" """
Monitors CPU and MEM usage and prints info in file. Monitors CPU and MEM usage and prints info in file.
""" """
@ -200,7 +205,8 @@ def main():
monitor_stats() monitor_stats()
else: else:
print(f'Command not found: {sys.argv[1]}') print(f'Command not found: {sys.argv[1]}', file=sys.stderr)
sys.exit(1)
if __name__ == '__main__': if __name__ == '__main__':