Python getpass Module
Example
Confirm the module is available (no interactive prompt):
import getpass
print(hasattr(getpass, "getpass"))
Try it Yourself »
Definition and Usage
The getpass module provides a secure way to handle password prompts that do not echo input.
Use it to read sensitive input from users on supported terminals without exposing typed characters.
Members
Member | Description |
---|---|
getpass() | Prompt for a password without echoing. |
getuser() | Return the "login name" of the user. |