September 2026
1051 pages
35h 4m
English
The getpass module enables the convenient entry of a password via the keyboard. The functions included in the getpass module are explained ahead. To run the examples, you must first import the module:
>>> import getpass
The getpass function reads an input from the user as input does and returns it as a string. The difference from input is that getpass is intended for entering passwords. This means that the user's input using getpass is covert; that is, it isn’t displayed in the console.
The optional prompt parameter can be used to specify the text that prompts the user for the password. The parameter is preset with "Password: ". For the second optional parameter, ...
Read now
Unlock full access