Python script to check disk space Windows

I am writing a python script to verify the utilization of each mount point is above the threshold or not
lets take threshold as 90%
here is the Python script to check disk space Windows
#Python Script to monitor disk space
import subprocess
threshold = 90
partition = “/”
df = subprocess.Popen([“df”,”-h”], stdout=subprocess.PIPE)
for line in df.stdout:
splitline = line.decode().split()
if splitline[5] == partition:

if int(splitline[4][:-1]) > threshold:


hope you liked it