input without echo back / passwords

Michael Hudson mwh21 at
Tue Mar 7 01:48:22 CET 2000

doyen at writes:

> I thought I'd seen this posted before, but how do I prompt for a
> password without
> showing what is entered on the screen. I'm currently using Windows, but
> would like a cross-platform solution if that is possible.

>>> import getpass
>>> getpass.getpass("enter junk> ")
enter junk> 

Works on unix; docs say it works on Mac & Windows too.

Have a nice day!


very few people approach me in real life and insist on proving they are
drooling idiots.                         -- Erik Naggum, comp.lang.lisp

More information about the Python-list mailing list