title: print something dynamically to replace the old printed thing and so on
body: <p>I'm trying to figure out how to do something that seems quite simple, but haven't achieved to do it yet.</p>
  
  <p>Basically, I just want to print something on the exact same line so that this new printed thing replace the old printed thing.</p>
  
  <p>Let's take this piece of code of example:</p>
  
  <pre><code>import time
  
  for i in range (0, 20):
      print(i)
      time.sleep(0.3)
  </code></pre>
  
  <p>I want the second output ("2") to replace the first one ("1"), then the third output ("3") to replace the second one, and so one. </p>
  
  <p>I've seen some old answers on the Internet, that say there's the "flush" parameter which I can add my print statement. So I tried:</p>
  
  <pre><code>import time
  
  for i in range (0, 20):
      print(i, flush=True)
      time.sleep(0.3)
  </code></pre>
  
  <p>Doesn't really change anything.</p>
  
  <ul>
  <li>I'm on Mac OS X if that implies anything -</li>
  </ul>
  
  <p>Thanks for any help</p>