title: How to print lines to the command line whilst keeping the header/column names at the top?
body: <p>How to print a continuous stream of data to stdout where the header columns are maintained at the top of the window?</p>
  
  <p>For example, instead of printing output in this format:</p>
  
  <pre><code>import random
  while True:
      data = tuple(random.random() for i in range(4))
      print('Column A: %.3f, Column B: %.3f, Column C: %.3f, Column D: %.3f' % data)
  
  Column A: 0.364, Column B: 0.311, Column C: 0.485, Column D: 0.272
  Column A: 0.366, Column B: 0.619, Column C: 0.280, Column D: 0.305
  Column A: 0.383, Column B: 0.119, Column C: 0.805, Column D: 0.778
  Column A: 0.764, Column B: 0.957, Column C: 0.756, Column D: 0.849
  Column A: 0.075, Column B: 0.909, Column C: 0.719, Column D: 0.749
  Column A: 0.576, Column B: 0.165, Column C: 0.834, Column D: 0.529
  Column A: 0.500, Column B: 0.404, Column C: 0.852, Column D: 0.782
  Column A: 0.023, Column B: 0.681, Column C: 0.002, Column D: 0.713
  Column A: 0.769, Column B: 0.523, Column C: 0.363, Column D: 0.044
  Column A: 0.558, Column B: 0.892, Column C: 0.249, Column D: 0.854
  </code></pre>
  
  <p>How to print it in this format (where the top header row is kept on screen no matter how many lines have been printed)?:</p>
  
  <pre><code>print('Column A\tColumn B\tColumn C\tColumn D')
  while True:
      data = tuple(random.random() for i in range(4))
      print('%.3f\t\t%.3f\t\t%.3f\t\t%.3f' % data)
  
  Column A    Column B    Column C    Column D
  0.376       0.549       0.180       0.812
  0.851       0.482       0.186       0.280
  0.369       0.423       0.065       0.282
  0.108       0.804       0.361       0.790
  0.615       0.600       0.133       0.623
  0.023       0.880       0.633       0.698
  0.611       0.313       0.461       0.728
  0.151       0.615       0.604       0.350
  0.700       0.418       0.072       0.647
  0.071       0.064       0.116       0.670
  </code></pre>