不知道为什么,本机测试必须要在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!')

 

相关文章:

  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2022-03-15
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2021-12-04
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
相关资源
相似解决方案