首页 > 编程语言 > 详细

python getpass模块:隐藏不显示输入的密码

时间:2016-08-08 22:39:30      阅读:334      评论:0      收藏:0      [点我收藏+]

不知道为什么,本机测试必须要在debug模式下才正常运行。。

import getpass                                  #用于隐藏用户输入的字符串,常用来接收密码

def checkuser(user,passwd):
    if user == chenhang and passwd == 123456:
        return True
    else:
        return False

if __name__ == "__main__":
    userr = input(Input the user:)
    passwdd = getpass.getpass(Input the passwd:)

    if checkuser(userr,passwdd):
        print(OK!)
    else:
        print(ERROR!)

 

python getpass模块:隐藏不显示输入的密码

原文:http://www.cnblogs.com/hanggegege/p/5751155.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!