On this page
  1. getpass.getpass
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

getpass.getpass

Up: getpass | Next: getpass.GetPassWarning
Rel: getpass.GetPassWarning, getpass.getuser
Ref: docs.python.org — getpass.getpass
Tags: #public #python3 #stdlib #getpass


Import

import getpass
from getpass import getpass

Signature & Overview

getpass.getpass(prompt='Password: ', stream=None, *, echo_char=None)

Prompt for a password, with echo turned off.

Usage

import getpass

# Prompts for a secret without echoing characters to the terminal:
# secret = getpass.getpass("API token: ")
assert callable(getpass.getpass)

Gotchas

REPL Inspect

from getpass import getpass
help(getpass)

Linked from

Related notes