title: Overwriting/clearing previous console line
body: <p>My problem is, that I want to be able to overwrite/clear previous printed line in python console. This question has been asked many times (<a href="https://stackoverflow.com/questions/5290994/python-remove-and-replace-printed-items">Python - Remove and Replace Printed items</a> for example), however with the very same code that is
  (the answer marked as correct, for me prints out nothing at all):</p>
  
  <pre><code>for i in range(10):
      print("Loading" + "." * i)
      time.sleep(1)
      sys.stdout.write("\033[F") # Cursor up one line
      sys.stdout.write("\033[K") # Clear to the end of line
  </code></pre>
  
  <p>I get the output (In python IDLE) :</p>
  
  <pre><code>Loading
  [F[KLoading.
  [F[KLoading..
  [F[KLoading...
  [F[KLoading....
  [F[KLoading.....
  [F[KLoading......
  [F[KLoading.......
  [F[KLoading........
  [F[KLoading.........
  [F[KLoading..........
  [F[K
  </code></pre>
  
  <p>Any ideas? I googled a lot, nothing works really. It either prints out nothing or just does not overwrite.</p>
  
  <p>If that helps, I am running windows 8.1 and Python 3.51. Running the code trough cmd doesn't affect anything.</p>
  
  <p>Also, adding <code>sys.stdout.flush()</code> does not help.</p>