title: Refreshing output text in Jupyter notebook
body: <p>I need to create kind of a monitor which refreshes itself periodically. So how can I properly refresh output of a cell? When I refresh the text using the code below the output pane collapses when being cleared creating annoying screen jumps.</p>
  
  <pre><code>from IPython import display
  import time
  while True:
      o = !netstat
      display.clear_output()
      display.publish_display_data({"text/plain":o.n})
      time.sleep(1)
  </code></pre>