title: watch command in python subprocess to print only the change in output
body: <p>I do use python subprocess module to get a status of an kubernetes application as follow: </p>
  
  <pre><code>command = gravity status | grep -o 'Cluster status:.*' | cut -f2- -d:
  
  def run_cmd(command):
      process  = subprocess.Popen(command,shell=True, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
      out, err = process.communicate()
      return out, err;
  </code></pre>
  
  <blockquote>
    <p><code>out:                active</code></p>
  </blockquote>
  
  <p>Does generate the output 'active' or 'degraded' but I would like to implement a <code>'watch'</code> so will print only when does change the <code>'active' to 'degraded'</code> and <code>'degraded' to 'active'</code> not to run every couple minutes to provide me the status. </p>
  
  <blockquote>
    <p>Question: how I can do this in python as a script or it is possible ?</p>
  </blockquote>