psutil
This commit is contained in:
parent
f058d240bd
commit
807fe1d479
@ -3,7 +3,6 @@
|
||||
import json
|
||||
import os
|
||||
import os.path
|
||||
import psutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
@ -140,6 +139,12 @@ def to_bar(x):
|
||||
|
||||
|
||||
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.
|
||||
"""
|
||||
@ -200,7 +205,8 @@ def main():
|
||||
monitor_stats()
|
||||
|
||||
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__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user