title: Python prompt for user with echo and password without echo
body: <p>Following code prompts for user and password, when run in console:</p>
  
  <pre><code>import getpass
  
  user = getpass.getpass("Username:")
  passwd = getpass.getpass("Password for " + user + ":")
  
  print "Got", user, passwd
  </code></pre>
  
  <p>The obvious problem with above is, user name is not echoed as it is typed.</p>
  
  <p>Now <a href="http://docs.python.org/2/library/getpass.html" rel="noreferrer"><code>getpass</code> documentation</a> says <em>"On Unix it defaults to using /dev/tty before falling back to sys.stdin and sys.stderr."</em></p>
  
  <p><strong>Question:</strong> How to ask for both username and password, so that they are read from same source, and username is echoed normally, while password is not?</p>