Python writes user Login interface

Source: Internet
Author: User

Accompanied by a flowchart can be seen, the first painting will slowly improve.

The code is as follows:

1.User User Name Store file

Wang 2,123 Zhang 31,234 Li 4,123,456


2.lock_user Locked User files



3. land.py Main Program Files


sysi=i<:     ()     account =  ()   /user account input      Lock_list =  (,)            / Open lock file (read and write)     lock_user = lock_list.readlines ()           /extract the retrieved information into List     User_list =  ()      user = user_list.readlines ()     Lock_line Lock_user:         lock_line = lock_line.strip ()      /remove \ n characters, extracting available information         account == Lock_line:             sys.exit (% account)     User_ account user:                 /separate user name, password          (User,password)  = user_account.strip (). Split ()          account == User:                     /Account matching Cycle              j = j < :                 passwd =  ()                   (passwd)  == Password:                      (%  account)                      sys.exit ()                  :                     j!=:                         (% (account,-j))                      j = j+:                 lock_list.write (account  + )   /password match failed, lock account                  sys.exit (% account)         :                            /account does not exist first pass, more than three exit system            :        i!=:             (% ( account,-i))     i +=:    sys.exit (% account ) Lock_ List.close () User_list.close ()


Python writes user Login interface

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.