title: Python print to stay on same line
body: <pre><code>import os
  import time
  
  h = 0
  s = 0
  m = 0
  
  while s &lt;= 60:
      os.system('clear')
      print h, "hours", m, 'minutes', s, 'seconds'
      time.sleep(1)
      s += 1
      if s == 60:
          m += 1
          s = 0
      elif m == 60:
          h += 1
          m = 0
          s = 0
  </code></pre>
  
  <p>I have this code above. It all works fine and does what it is meant to do, but I want to make it so that it prints all the statements in the same line. For example, it should print out 0 hours 0 minutes 0 seconds and then on the same line should print out 0 hours 0 minutes 1 second, with the second variable the only thing that is changing. How do I do this? I have already tried using the os.system('clear') command but it does not work. Im running this on Mac OSX 10.7.</p>