subject
Computers and Technology, 05.10.2021 20:10 bloop3r

#!/usr/bin/env python3 import shutil

import psutil

def check_disk_usage(disk):

"""Verifies that there's enough free space on disk"""

du = shutil. disk_usage(disk)

free = du. free / du. total * 100

return free > 20

def check_cpu_usage():

"""Verifies that there's enough unused CPU"""

usage = psutil. cpu_percent(1)

return usage <75

#If there's not enough disk, or not enough CPU, print an error

if not check_disk_usage('/') or not check_cpu_usage():

print("ERROR!")

print("Everything ok")

else:

print("Network checks failed")

i cant seem to find the bug in the code, ive written it multiple times. can someone help me?


#!/usr/bin/env python3

import shutilimport psutildef check_disk_usage(disk): Verifies that the

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 15:00
Based on the current economic situation do you expect the employment demand for graduating engineers to increase or decrease? explain the basis for your answer. with a significant economic recovery, what do you think will happen to future enrollments in graduating engineering programs?
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
Me ajude por favor , coloquei uma senha e nĂŁo consigo tira-la no chorme
Answers: 2
question
Computers and Technology, 24.06.2019 23:30
True or false when a host gets an ip address from a dhcp server it is said to be configured manually
Answers: 1
question
Computers and Technology, 25.06.2019 13:40
We are looking at a “sum-scan” (a scan with addition as the operator).sum-scan has two variants. in an “exclusive sum-scan”, the output at each data element isthe sum of all the input elements that came before that element. in an “inclusive sum-scan”,the output at each data element is the sum of all the input elements up to?
Answers: 2
You know the right answer?
#!/usr/bin/env python3 import shutil

import psutil

def check_disk_usage(disk...
Questions
question
Mathematics, 25.01.2022 02:00