title: Delete last printed character python
body: <p>I am writing a program in Python and want to replace the last character printed in the terminal with another character.</p>
  
  <p>Pseudo code is:</p>
  
  <pre><code>print "Ofen",
  print "\b", # NOT NECCESARILY \b, BUT the wanted print statement that will erase the last character printed
  print "r"
  </code></pre>
  
  <p>I'm using Windows8 OS, Python 2.7, and the regular interpreter. </p>
  
  <p>All of the options I saw so far didn't work for me. (such as: <code>\010</code>, <code>'\033[#D'</code> (# is 1), <code>'\r'</code>). </p>
  
  <p>These options were suggested in other Stack Overflow questions or other resources and don't seem to work for me.</p>
  
  <p><strong>EDIT</strong>: also using <code>sys.stdout.write</code> doesn't change the affect. It just doesn't erase the last printed character. Instead, when using <code>sys.stdout.write</code>, my output is:</p>
  
  <pre><code>Ofenr # with a square before 'r'
  </code></pre>
  
  <p>My questions:</p>
  
  <ol>
  <li>Why don't these options work?</li>
  <li>How do I achieve the desired output?</li>
  <li>Is this related to Windows OS or Python 2.7?</li>
  <li>When I find how to do it, is it possible to erase manually (using the wanted eraser), delete the <code>'\n'</code> that is printed in python's <code>print</code> statement?</li>
  </ol>