This article mainly provides an in-depth analysis of the method of hiding the input password during python3 interaction. It has a certain reference value. Interested friends can refer to it
# Auther: Aaron Fan #这个脚本请在命令行去执行才可以试出效果,pycharm这里无法测试这个脚本,切记! import getpass _username = "Aaron" _passwd = "abc,123" username = input("请输入你的用户名: ") #getpass这个模块可以帮助你输入密码时把密码隐藏 passwd = getpass.getpass("请输入你的密码: ") if username == _username and passwd == _passwd: print("你的用户名密码输入正确。") else: print("你的用户名或者密码错误!")
The above is the detailed content of How to hide password input during python3 interaction. For more information, please follow other related articles on the PHP Chinese website!