Rate This Document
Findability
Accuracy
Completeness
Readability

Drive Information

Run the shell command df -h to query drive information.

Example:

def get_disc_info():
        #disc_info = os.popen("df -h").read()
        #disc_info = subprocess.Popen("df -h", shell=True).communicate()[0]
        #print(disc_info)
        pipe = subprocess.Popen("df -h", stdout=subprocess.PIPE, shell=True)
        disc_info = pipe.stdout.read()
        print(disc_info)