Python getpass module - GeeksforGeeks
www.geeksforgeeks.org › python-getpass-moduleDec 23, 2020 · getpass.getuser () getpass () In many programs we need a secure the data or program then this case we use some secret key or passwords to identifying the users. Using getpass () it is possible to accept the password in python program. Python3 import getpass pwd = getpass.getpass (prompt = 'Enter the password') if pwd == 'Admin': print('Unlock!')
Python getpass module - JournalDev
www.journaldev.com › 20555 › python-getpass-modulePython getpass with other stream. Disabling terminal echoes of the password and diverting input to any other stream is also possible with getpass() function. Just pass the stream to the function as well: import getpass import sys pwd = getpass.getpass(stream=sys.stderr) print('You entered:', pwd) Let’s see the output for this program: