shell rerouting

Alex Martelli aleax at aleax.it
Thu Feb 13 04:00:59 EST 2003


Dave Harrison wrote:

> Im looking to take input at the command line (a password) but I dont want
> the input to either be visible, or to enter the shell logs.
> 
> My current solution will be to reroute some shell input, but I cant work
> out how to do this.
> 
> Alternatively Im open to other pythonic solutions ;-)

>>> import getpass
>>> x = getpass.getpass('Password: ')
Password:
>>> print x
easy...!
>>>


Alex





More information about the Python-list mailing list