python3.5.2库getpass
时间:2018-08-06 22:03:38
收藏:0
阅读:142
getpass的功能是:允许隐式的输入字符串
import getpass
_username=‘vigossr‘
_password=‘haha‘
username=input(‘username: ‘)
password=getpass.getpass(‘password: ‘)
if _username==username and _password==password:
print(‘Welcom {username}!‘.format(username=username))
else:
print(‘Invalid username/password‘)
Note: Pycharm无法运行,可以在linux服务器上执行
原文:https://www.cnblogs.com/vigossr/p/9433640.html
评论(0)