title: converting a shell script into python program
body: <p>I have tried writing a shell script which alerts admin when the disk usage reaches up to 70%. I want write this script in python</p>
  
  <pre><code>#!/bin/bash
  ADMIN="admin@myaccount.com"
  INFORM=70
  
  df -H  | grep -vE ‘^Filesystem|tmpfs|cdrom’ | awk ‘{ print $5 ” ” $6 }’ | while read   output;
  do
  use=$(echo $output | awk ‘{ print $1}’ | cut -d’%’ -f1  )
  partition=$(echo $output | awk ‘{ print $2 }’ )
  if [ $use -ge $INFORM ]; then
  echo “Running out of space \”$partition ($use%)\” on $(hostname) as on $(date)” |
  mail -s “DISK SPACE ALERT: $(hostname)” $ADMIN
  fi
  done
  </code></pre>