Question: Can you help me make the functions work with the 3 imported modules only? I need to write the code inside each functions to make
Can you help me make the functions work with the 3 imported modules only?
I need to write the code inside each functions to make it work. The instructions are given in quotations ("") under each function (def). The graph will be in "[=========== ]" format. Each equal sign ( = ) means 5%.
Thank you!
import os,sys,subprocess
def call_df():
"Use this to call the df command and return a list of output" pass # replace pass with your code
def call_free():
"Use this to call the free command and return a list of output" pass # replace pass with your code
def call_hostname():
"Use this to call the hostname command and return a string" pass # replace pass with your code
def call_uptime():
"Use this to call the uptime command and return a string" pass # replace pass with your code
def percent_to_graph(percent):
"draw a graph to represent a given percentage" return_string = "[========== ]" # 50% as example return return_string #code
def print_percent_line(name, percent):
"use this to print your lines in order pass checks" string = '{:<12}{:>22} {:<3}%'.format(name, percent_to_graph(percent), percent) print(string)
def print_horizontal_line(length=40, char='-'):
"prints a horizontal line " print(char*length)
if __name__ == "__main__":
pass # replace with your code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
