input without echo back / passwords

Michael Hudson mwh21 at cam.ac.uk
Tue Mar 7 01:48:22 CET 2000


doyen at mediaone.net 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> 
'fsdfsdfse'

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

Have a nice day!

M.

-- 
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