Get the output using subprocess.
Btw, I don't get the number of inodes with
import subprocess output = subprocess.run(['df', '-h'], stdout=subprocess.PIPE).stdout output = output.decode('utf-8') for line in output.split('\n'): if line.startswith('Inode count:'): inode_cnt = int(line.split()[1])Something like that.
Btw, I don't get the number of inodes with
df -h
.