用python写的登录程序

#!/usr/bin/env pythonpython

# coding:utf-8ide

__author__ = "lvah"测试

 

'''spa

@author:linweiblog

@file:linwei.pyutf-8

@contact:xc_123456789@qq.comget

@time:6/26/179:33 AMinput

@descit

'''io

i = 0

for i in range(0, 3):

    username = raw_input("user:")

    password = raw_input("password:")

    if (username == 'root') and (password == 'redhat'):

        print ("                             ")

        print ("welcome to user manage system")

        break

    elif (username != 'root') or (password != 'redhat'):

        print ("密码错误,请从新输入")

        i = i + 1

else:

    print ("                             ")

    print ("你已经登录过三次请10分钟后再登录")

 

测试

wKioL1lSYxehkzPDAABPEGPqgws452.png-wh_50

wKiom1lSYxixbwl3AACYNa-Sd8k177.png-wh_50

相关文章
相关标签/搜索