title: python overwrite previous line
body: <p>how do you overwrite the previous print in python 2.7?
  I am making a simple program to calculate pi. here is the code:</p>
  
  <pre><code>o = 0
  hpi = 1.0
  i = 1
  print "pi calculator"
  acc= int(raw_input("enter accuracy:"))
  if(acc&gt;999999):
          print "WARNING: this might take a VERY long time. to terminate, press CTRL+Z"
  print "precision: " + str(acc)
  while i &lt; acc:
          if(o==0):
                  hpi *= (1.0+i)/i
                  o = 1
          elif(o==1):
                  hpi *= i/(1.0+i)
                  o = 0
          else:
                  print "loop error."
          i += 1
          if i % 100000 == 0:
                  print str(hpi*2))
  print str(hpi*2))
  </code></pre>
  
  <p>It basicly outputs the current pi after 100000 calculations. how can I make it overwrite the previous calculation?</p>