-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsysinf.py
More file actions
19 lines (16 loc) · 888 Bytes
/
sysinf.py
File metadata and controls
19 lines (16 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#Developer: Curly60e
#PyBLOCK its a clock of the Bitcoin blockchain.
#Version: 0.6.0b
import psutil
def sysinfoDetail(): #Cpu and memory usage
try:
# gives a single float value
print(" \033[0;37;40m----------------------------")
print(" \033[3;33;40mCPU Usage: \033[1;32;40m" + str(psutil.cpu_percent()) + "\033[0;37;40m%")
print(" \033[3;33;40mMemory Usage: \033[1;32;40m" "{}\033[0;37;40m%".format(int(psutil.virtual_memory().percent)))
print(" \033[3;33;40mMemory Available: \033[1;32;40m" "{} \033[0;37;40mMB".format(int(psutil.virtual_memory().available / 1024 / 1024)))
print(" \033[3;33;40mDisk Usage: \033[1;32;40m" "{}%\033[0;37;40m%".format(psutil.disk_usage('/').percent))
print(" \033[0;37;40m----------------------------")
except (KeyboardInterrupt, SystemExit):
exit()
raise