Computers and Technology
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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 13:00, torresnoemi899
Which of the following statements is false? a. a class can directly inherit from class object. b. if the class you're inheriting from declares instance variables as private, the inherited class can access those instance variables directly. c. a class's instance variables are normally declared private to enforce good software engineering. d. it's often much more efficient to create a class by inheriting from a similar class than to create the class by writing every line of code the new class requires.
Answers: 3
image
Computers and Technology, 24.06.2019 11:00, airbenderjermai
Need fast im timed in a paragraph of 125 words, explain at least three ways that engineers explore possible solutions in their projects.
Answers: 2
image
Computers and Technology, 24.06.2019 15:30, livagrace
Emma is using an artificial intelligence system, which contains information on botany, to identify a type of plant from an image. what type of ai is emma using?
Answers: 1
image
Computers and Technology, 24.06.2019 18:30, shemiahking5432
Jacking is a crime that takes place when a hacker misdirects url to a different site. the link itself looks safe, but the user is directed to an unsafe page
Answers: 1
Do you know the correct answer?
#!/usr/bin/env python3 import shutil

import psutil

def check_disk_usage(disk...

Questions in other subjects:

Konu
English, 19.11.2020 20:10