title: How to turn off “child.logfile=sys.stdout” in pexpect?
body: <p>I’m new on Python. Recently I wrote an script to ssh to server by using “pexpect”
  To show the login process, I redirect the logfile to stdout. 
  At the end of script, it will hand over the control to user. 
  When I type on command prompt, all keys I typed became double. 
  I think this is due to sending log file to stdout.
  How do I turn it off? 
  I tried many suggestion from the web, but none does help.<br>
  Please help. 
  Thanks a lot, 
  Sheng</p>
  
  <p>Below is my script:</p>
  
  <pre><code>def login_with_ip_on_the_list():
      global user_input_argv2
      child=pexpect.spawn('ssh xxx@xx.xx.xx.xx’)
     #child.logfile=sys.stdout #display progress on screen
      child.expect(['password','Password'])
      child.sendline(‘xxxxx’)
      child.expect(‘xxx)
      child.sendline('\r')
      child.expect(‘xxx’)
      child.sendline('\r')
      child.interact()
  </code></pre>