title: How do I press "Enter" button after the password is passed through command-line?
body: <p>I used the following code, which runs the command and prompts password. When I entered the password using sendline, for some reason the login is not happening.</p>
  
  <p>How to debug this and ensure the "Enter" button is sent?</p>
  
  <p>Code:</p>
  
  <pre><code>    child = pexpect.spawn('tool --server=commander.company.com login username',logfile=sys.stdout)
      child.expect('Password:')
      child.sendline('com0201')
  </code></pre>