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 22:30
Write a full class definition for a class named player , and containing the following members: a data member name of type string .a data member score of type int .a member function called setname that accepts a parameter and assigns it to name . the function returns no value.a member function called setscore that accepts a parameter and assigns it to score . the function returns no value.a member function called getname that accepts no parameters and returns the value of name .a member function called getscore that accepts no parameters and returns the value of score .this is what i have, aparently this is wrong: class player{private: string name; int score; public: void player: : setname (string n){name =n; }void player: : setscore (int s){score = s; }string player: : getname (){return name; }int player: : getscore (){return score; }};
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
One of your customers wants you to build a personal server that he can use in his home. one of his concerns is making sure he has at least one backup of their data stored on the server in the event that a disk fails. you have decided to back up his data using raid. since this server is for personal use only, the customer wants to keep costs down. therefore, he would like to keep the number of drives to a minimum. which of the following raid systems would best meet the customer's specifications? a. raid 0 b. raid 1 c. raid 5 d. raid 10
Answers: 3
question
Computers and Technology, 23.06.2019 02:00
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
What are three software programs for mobile computing?
Answers: 1
You know the right answer?
#!/usr/bin/env python3 import shutil

import psutil

def check_disk_usage(disk...
Questions
Questions on the website: 13722362