getpass可以隐藏输入信息, 但是在Pycharm上看不到效果,需要在dos窗口中执行
import getpass pwd = getpass.getpass('请输入密码:') print(pwd)