今天无意中发现python的getpass模块,就简单写了一下登录一个软件的代码:
getpass.getpass(‘提示字符串’):会显示提示字符串, 关闭键盘的屏幕回显,然后读取密码,即密码不显示。
import getpass
count = 0
while count < 5:
username = input("usename:")
password = getpass.getpass("password:")
今天无意中发现python的getpass模块,就简单写了一下登录一个软件的代码:
getpass.getpass(‘提示字符串’):会显示提示字符串, 关闭键盘的屏幕回显,然后读取密码,即密码不显示。
import getpass
count = 0
while count < 5:
username = input("usename:")
password = getpass.getpass("password:")