title: Erasing output from ssh
body: <p>Hi I have a simple script for ssh connection to cisco switch and I want to get running configuration of the device. The script is written to use if necessary multiple <code>show</code> commands so I'm using <code>invoke_shell()</code>.</p>
  <p>To avoid waiting for spacebar to be pressed I've added simple <code>while</code> loop.</p>
  <pre><code>    while str(recieve).__contains__('--More--'):
          channel.send(' \n')
          time.sleep(1)
          recieve = channel.recv(10000)
          final += str(recieve.decode(&quot;ascii&quot;))
  </code></pre>
  <p>And here is the issue.</p>
  <p>If I then printout <code>final</code> it shows full <code>show run</code> command without <code>--More--</code> but when I write contents of <code>final</code> variable to file it adds this string:  <code>--More--         </code>.</p>
  <p>I've tried to look in string with <code>replace('--More--', '')</code> but it didn't find that string.</p>