交互提示输入用户密码的python脚本

  • Post author:
  • Post category:python


交互提示输入用户密码的python脚本:

vi a1.py

#!/usr/bin/python

while True:

 input = raw_input('Please input your username:')
 if input == "aa":
          password = raw_input('Please input your pass:')
          p = '123456'
          while password != p:
                password = raw_input('Please input your pass again:')
          if password == p:
                print 'welcome to system!'
                break

:wq

python a1.py

转载于:https://blog.51cto.com/yangzhiming/2125072