title: Is there a way to delete output in Python IDLE
body: <p>I have a doubt here, I am using Python IDLE 3.8.5 [MSC v.1926 32 bit (Intel)] with Windows 7 64-bit.</p>
  <p>I want to create a countdown timer, but with this code :</p>
  <pre><code>for sec in range(10) :
      print(sec + 1)
  </code></pre>
  <p>the output is :
  1
  2
  3
  4
  5
  6
  7
  8
  9
  10</p>
  <p>Whereas what I want is :</p>
  <pre><code>1 #erases output and then prints 2 and so on
  </code></pre>
  <p>How do I solve this?</p>
  <p>I have tried the following ways from the internet and stack overflow itself :</p>
  <p>1.Ansi codes :- ('\033c'), ('\x1bc')</p>
  <p>2.system('cls') and 'clear' (It shows the cmd for a split second and then quits)</p>
  <p>3.sys.stdout.flush</p>
  <p>4.subprocess call system('cls') and 'clear'</p>
  <p>5.Ansi codes:-'\x1b[1A')</p>
  <pre><code>#delete last line
  sys.stdout.write('\x1b[2K')
  </code></pre>
  <p>6.using ('\r') and ('\b')</p>
  <p>Please help me, it will be a lot of use to me if you guys tell me the solution.</p>