To read username and password in asterisk **** way in python. Follow the below code snippet written in python.
from getpass import getpass
name = input('Enter username :')
password = getpass('Enter Password :')
Enter username : similargeeks
Enter Password : *********