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, 22.06.2019 23:00
Which type of tab stop is most for weights and measurements?
Answers: 1
question
Computers and Technology, 25.06.2019 05:00
How many meatballs required for a larty of 25 adults and 6 children
Answers: 1
question
Computers and Technology, 25.06.2019 05:30
Why are weather forecasts more reliable now compared of hundred years ago
Answers: 1
question
Computers and Technology, 25.06.2019 08:40
Which of the following statements is incorrect in relation to processes: while, strictly speaking, at any instant of time, the cpu is running only one process, in the course of 1 second, it may work on several of them, giving the illusion of parallelism a process is just an instance of an executing program, including the current values of the program counter, registers, and variables processes can be created when an operating system is booted, created by the user, or a running process can create children processes there is a master process, which when started can last forever, and is not killable
Answers: 3
You know the right answer?
#!/usr/bin/env python3 import shutil

import psutil

def check_disk_usage(disk...
Questions
question
English, 11.01.2021 01:50
question
Mathematics, 11.01.2021 01:50
Questions on the website: 13722363