getpass()

Read syntax diagramSkip visual syntax diagramgetpass(prompt)

Function

Prints prompt on the controlling TTY and reads and returns one line of input with terminal echo suppressed.

Parameters

prompt
A string that prints on the controlling TTY

Example

To prompt for a password and read it:
psw=getpass('enter password')