Python's Authoring Login interface

Source: Internet
Author: User
#coding: Gbk#author:zhbimport getpass,os,sysos.system (' cls ') i=0while i<3:name=raw_input (' Enter user name: ') lock_file=  Open (R ' account_lock.txt ', ' r+ ') for Lock_line in Lock_file.readlines (): Lock_line=lock_line.strip (' \ n ') if Lock_line==name:sys.exit (' user%s ' exists in the locked file! Please login to operation and maintenance platform again! '%name) Else:pass User_file=open (r        ' Account.txt ', ' R ') for User_line in User_file.readlines (): (User,password) =user_line.strip (' \ n '). Split () If user==name:j=0 while J<3:passwd=getpass.getpass ("Input password:") if pas                        Sword==passwd:sys.exit ("Warmly welcome%s into operation and maintenance platform"%name) else:if j!=2: Print ("Password input error, user%s has%d input opportunity"% (NAME,2-J)) J+=1 else: #密码输错3次, locked and appended to Account_lock.txt Lock_file.write (name+ ' \ n ') sys.exit ("The account%s has been locked since the password was entered 3 times, please contact the IT staff to unbind"%name) Else:pass i+= 1else:sys.exit (' User not present in system '%s, please log back in '%name ') 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.