getpass.getpass()
getpass.getpass() is a Python function in the Getpass Module category. Prompts the user for a password without echoing the input. The syntax is getpass.getpass(prompt="Password: ", stream=None). Parameters: prompt — displayed prompt. Returns: Password string. A typical example: import getpass
password = getpass.getpass("Enter password: ")
# Input is hidden (no echo). A close sibling is getpass.getuser(), which returns the current user's login name. More about this category: Password input — getpass, getuser. Related Getpass Module entries: getpass.getuser(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try getpass.getpass() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.