#!/usr/bin/env python3
import shutil
import psutil
def check_disk_usage(disk...
![subject](/tpl/images/cats/informatica.png)
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?
![ansver](/tpl/images/cats/User.png)
Answers: 2
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 00:40
Consider the following statements: struct nametype{string first; string last; }; struct coursetype{string name; int callnum; int credits; char grade; }; struct studenttype{nametype name; double gpa; coursetype course; }; studenttype student; studenttype classlist[100]; coursetype course; nametype name; mark the following statements as valid or invalid. if a statement is invalid, explain why.a.) student.course.callnum = "csc230"; b.) cin > > student.name; c.) classlist[0] = name; d.) classlist[1].gpa = 3.45; e.) name = classlist[15].name; f.) student.name = name; g.) cout < < classlist[10] < < endl; h.) for (int j = 0; j < 100; j++)classlist[j].name = name; i.) classlist.course.credits = 3; j.) course = studenttype.course;
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 03:50
Iam a bacterium. i cause stomach cramps and diarrhea. i am caused by eating rotten foodssuch as chicken, fish, or eggs. sometimes turtles carry my bacteria.what am i?
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 08:30
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 21:00
Which set of steps will organize the data to only show foods with more than 100 calories and rank their sugar content from greatest to least?
Answers: 1
You know the right answer?
Questions
![question](/tpl/images/cats/en.png)
English, 19.07.2020 23:01
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mkx.png)
Arts, 19.07.2020 23:01
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
History, 19.07.2020 23:01
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 19.07.2020 23:01
![question](/tpl/images/cats/himiya.png)
Chemistry, 19.07.2020 23:01
![question](/tpl/images/cats/en.png)
English, 19.07.2020 23:01
![question](/tpl/images/cats/en.png)
English, 19.07.2020 23:01
![question](/tpl/images/cats/mat.png)
Mathematics, 19.07.2020 23:01
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 19.07.2020 23:01
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)