2019-03-01
阅读量:
532
python如何提高录入密码的安全性
某些程序要求提出安全问题,而不是要求更改密码以提高安全性。在这里,提示可以更改为任何值。
# A simple Python program to demonstrate
# getpass.getpass() to read security question
import getpass
p = getpass.getpass(prompt='Your favorite flower? ')
if p.lower() == 'rose':
print('Welcome..!!!')
else:
print('The answer entered by you is incorrect..!!!')
输出 :
$ python3 getpass_example2.py
Your favorite flower?
Welcome..!!!
$ python3 getpass_example2.py
Your favorite flower?
The answer entered by you is incorrect..!!!






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
1条评论