Python login interface design, python login interface

Source: Internet
Author: User

Python login interface design, python login interface

I just started learning Python, the first program written.

Import osuser_file = comment ', 'R') user_list = user_file.readlines () user_file.close () while True: lock_file = comment', 'r + ') lock_list = lock_file.readlines () lock_file.close () login_Success = False user_name = input ('user :'). strip () for line1 in lock_list: line1 = line1.split () if user_name = line1 [0]: print ("Sorry, you are already in the block list, get the fucking out! ") Exit () for line2 in user_list: line2 = line2.split () if user_name = line2 [0]: for I in range (3): password = input ('password: '). strip () if password = line2 [1]: print ("Welcome % s login my system! "% User_name) login_Success = True break else: f = open('lock_file.txt ', 'A') f. write ('% s \ n' % user_name) f. close () print ("Entered 3 times of wrong passwd, going to lock % s" % user_name) if login_Success = True: break if login_Success = True: breakView Code

 

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.