title: python - how to apply backspaces to a string
body: <p>I have a string</p>
  
  <pre><code>s = '--two \x08--three'
  </code></pre>
  
  <p>When I print, I get</p>
  
  <pre><code>--two--three
  </code></pre>
  
  <p>but can I do something to have</p>
  
  <pre><code>s='--two--three'
  </code></pre>
  
  <p>with out declaring it explicitly.</p>
  
  <p>I do not need to store or even know about the back spaces. I just want to manipulate the text without the backspace characters there. How can I achieve this?</p>
  
  <p>Edit: Hopefully I can clarify a little. Say I have two strings</p>
  
  <pre><code>test1 = 'a\bb' #b
  test2 = 'b' #b
  </code></pre>
  
  <p>When they are printed, they are equivalent to the user, but <code>test1!=test2</code>. What I am doing is pulling some output from a terminal. This output has backspaces throughout. I want to be able to manipulate the end result, search for words, edit the string without worrying about the backspaces.</p>
  
  <p>Edit 2: I guess what I really want is to set a variable as the result of a print statement</p>
  
  <pre><code>a = print("5\bA") #a='A' #does not work like this
  </code></pre>